Fix warnings discovered on macos

This commit is contained in:
Jason Turner 2010-08-28 17:58:02 +00:00
parent c5f20ea158
commit 329244759f
2 changed files with 21 additions and 20 deletions

View File

@ -52,7 +52,8 @@ endif(READLINE_LIBRARY)
IF(MSVC) IF(MSVC)
ADD_DEFINITIONS(/W4) ADD_DEFINITIONS(/W4)
ELSE() ELSE()
ADD_DEFINITIONS(-Wall -Wextra) # -Wno-missing-field-initializers is for boost on macos
ADD_DEFINITIONS(-Wall -Wextra -Wno-missing-field-initializers)
ENDIF() ENDIF()
include_directories(include) include_directories(include)

View File

@ -1052,10 +1052,10 @@ namespace chaiscript
if (Equation()) { if (Equation()) {
retval = true; retval = true;
while (Eol()); while (Eol()) {}
if (Char(',')) { if (Char(',')) {
do { do {
while (Eol()); while (Eol()) {}
if (!Equation()) { if (!Equation()) {
throw Eval_Error("Unexpected value in parameter list", File_Position(line, col), filename); throw Eval_Error("Unexpected value in parameter list", File_Position(line, col), filename);
} }
@ -1081,10 +1081,10 @@ namespace chaiscript
} }
else if (Map_Pair()) { else if (Map_Pair()) {
retval = true; retval = true;
while (Eol()); while (Eol()) {}
if (Char(',')) { if (Char(',')) {
do { do {
while (Eol()); while (Eol()) {}
if (!Map_Pair()) { if (!Map_Pair()) {
throw Eval_Error("Unexpected value in container", File_Position(line, col), filename); throw Eval_Error("Unexpected value in container", File_Position(line, col), filename);
} }
@ -1115,7 +1115,7 @@ namespace chaiscript
} }
} }
while (Eol()); while (Eol()) {}
if (!Block()) { if (!Block()) {
throw Eval_Error("Incomplete anonymous function", File_Position(line, col), filename); throw Eval_Error("Incomplete anonymous function", File_Position(line, col), filename);
@ -1137,7 +1137,7 @@ namespace chaiscript
TokenPtr annotation; TokenPtr annotation;
if (Annotation()) { if (Annotation()) {
while (Eol_()); while (Eol_()) {}
annotation = match_stack.back(); annotation = match_stack.back();
match_stack.pop_back(); match_stack.pop_back();
is_annotated = true; is_annotated = true;
@ -1168,7 +1168,7 @@ namespace chaiscript
} }
} }
while (Eol()); while (Eol()) {}
if (Char(':')) { if (Char(':')) {
if (!Operator()) { if (!Operator()) {
@ -1176,7 +1176,7 @@ namespace chaiscript
} }
} }
while (Eol()); while (Eol()) {}
if (!Block()) { if (!Block()) {
throw Eval_Error("Incomplete function definition", File_Position(line, col), filename); throw Eval_Error("Incomplete function definition", File_Position(line, col), filename);
} }
@ -1207,7 +1207,7 @@ namespace chaiscript
if (Keyword("try")) { if (Keyword("try")) {
retval = true; retval = true;
while (Eol()); while (Eol()) {}
if (!Block()) { if (!Block()) {
throw Eval_Error("Incomplete 'try' block", File_Position(line, col), filename); throw Eval_Error("Incomplete 'try' block", File_Position(line, col), filename);
@ -1215,7 +1215,7 @@ namespace chaiscript
bool has_matches = true; bool has_matches = true;
while (has_matches) { while (has_matches) {
while (Eol()); while (Eol()) {}
has_matches = false; has_matches = false;
if (Keyword("catch", false)) { if (Keyword("catch", false)) {
int catch_stack_top = match_stack.size(); int catch_stack_top = match_stack.size();
@ -1230,7 +1230,7 @@ namespace chaiscript
} }
} }
while (Eol()); while (Eol()) {}
if (!Block()) { if (!Block()) {
throw Eval_Error("Incomplete 'catch' block", File_Position(line, col), filename); throw Eval_Error("Incomplete 'catch' block", File_Position(line, col), filename);
@ -1239,11 +1239,11 @@ namespace chaiscript
has_matches = true; has_matches = true;
} }
} }
while (Eol()); while (Eol()) {}
if (Keyword("finally", false)) { if (Keyword("finally", false)) {
int finally_stack_top = match_stack.size(); int finally_stack_top = match_stack.size();
while (Eol()); while (Eol()) {}
if (!Block()) { if (!Block()) {
throw Eval_Error("Incomplete 'finally' block", File_Position(line, col), filename); throw Eval_Error("Incomplete 'finally' block", File_Position(line, col), filename);
@ -1276,7 +1276,7 @@ namespace chaiscript
throw Eval_Error("Incomplete 'if' expression", File_Position(line, col), filename); throw Eval_Error("Incomplete 'if' expression", File_Position(line, col), filename);
} }
while (Eol()); while (Eol()) {}
if (!Block()) { if (!Block()) {
throw Eval_Error("Incomplete 'if' block", File_Position(line, col), filename); throw Eval_Error("Incomplete 'if' block", File_Position(line, col), filename);
@ -1284,7 +1284,7 @@ namespace chaiscript
bool has_matches = true; bool has_matches = true;
while (has_matches) { while (has_matches) {
while (Eol()); while (Eol()) {}
has_matches = false; has_matches = false;
if (Keyword("else", true)) { if (Keyword("else", true)) {
if (Keyword("if")) { if (Keyword("if")) {
@ -1297,7 +1297,7 @@ namespace chaiscript
throw Eval_Error("Incomplete 'else if' expression", File_Position(line, col), filename); throw Eval_Error("Incomplete 'else if' expression", File_Position(line, col), filename);
} }
while (Eol()); while (Eol()) {}
if (!Block()) { if (!Block()) {
throw Eval_Error("Incomplete 'else if' block", File_Position(line, col), filename); throw Eval_Error("Incomplete 'else if' block", File_Position(line, col), filename);
@ -1305,7 +1305,7 @@ namespace chaiscript
has_matches = true; has_matches = true;
} }
else { else {
while (Eol()); while (Eol()) {}
if (!Block()) { if (!Block()) {
throw Eval_Error("Incomplete 'else' block", File_Position(line, col), filename); throw Eval_Error("Incomplete 'else' block", File_Position(line, col), filename);
@ -1340,7 +1340,7 @@ namespace chaiscript
throw Eval_Error("Incomplete 'while' expression", File_Position(line, col), filename); throw Eval_Error("Incomplete 'while' expression", File_Position(line, col), filename);
} }
while (Eol()); while (Eol()) {}
if (!Block()) { if (!Block()) {
throw Eval_Error("Incomplete 'while' block", File_Position(line, col), filename); throw Eval_Error("Incomplete 'while' block", File_Position(line, col), filename);
@ -1385,7 +1385,7 @@ namespace chaiscript
throw Eval_Error("Incomplete 'for' expression", File_Position(line, col), filename); throw Eval_Error("Incomplete 'for' expression", File_Position(line, col), filename);
} }
while (Eol()); while (Eol()) {}
if (!Block()) { if (!Block()) {
throw Eval_Error("Incomplete 'for' block", File_Position(line, col), filename); throw Eval_Error("Incomplete 'for' block", File_Position(line, col), filename);