From 329244759f822ae2b135285dde09734567d4f9db Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sat, 28 Aug 2010 17:58:02 +0000 Subject: [PATCH] Fix warnings discovered on macos --- CMakeLists.txt | 3 +- .../chaiscript/language/chaiscript_parser.hpp | 38 +++++++++---------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3de17222..61ca25f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,8 @@ endif(READLINE_LIBRARY) IF(MSVC) ADD_DEFINITIONS(/W4) ELSE() - ADD_DEFINITIONS(-Wall -Wextra) + # -Wno-missing-field-initializers is for boost on macos + ADD_DEFINITIONS(-Wall -Wextra -Wno-missing-field-initializers) ENDIF() include_directories(include) diff --git a/include/chaiscript/language/chaiscript_parser.hpp b/include/chaiscript/language/chaiscript_parser.hpp index d0d8130f..2e05f624 100644 --- a/include/chaiscript/language/chaiscript_parser.hpp +++ b/include/chaiscript/language/chaiscript_parser.hpp @@ -1052,10 +1052,10 @@ namespace chaiscript if (Equation()) { retval = true; - while (Eol()); + while (Eol()) {} if (Char(',')) { do { - while (Eol()); + while (Eol()) {} if (!Equation()) { throw Eval_Error("Unexpected value in parameter list", File_Position(line, col), filename); } @@ -1081,10 +1081,10 @@ namespace chaiscript } else if (Map_Pair()) { retval = true; - while (Eol()); + while (Eol()) {} if (Char(',')) { do { - while (Eol()); + while (Eol()) {} if (!Map_Pair()) { throw Eval_Error("Unexpected value in container", File_Position(line, col), filename); } @@ -1115,7 +1115,7 @@ namespace chaiscript } } - while (Eol()); + while (Eol()) {} if (!Block()) { throw Eval_Error("Incomplete anonymous function", File_Position(line, col), filename); @@ -1137,7 +1137,7 @@ namespace chaiscript TokenPtr annotation; if (Annotation()) { - while (Eol_()); + while (Eol_()) {} annotation = match_stack.back(); match_stack.pop_back(); is_annotated = true; @@ -1168,7 +1168,7 @@ namespace chaiscript } } - while (Eol()); + while (Eol()) {} if (Char(':')) { if (!Operator()) { @@ -1176,7 +1176,7 @@ namespace chaiscript } } - while (Eol()); + while (Eol()) {} if (!Block()) { throw Eval_Error("Incomplete function definition", File_Position(line, col), filename); } @@ -1207,7 +1207,7 @@ namespace chaiscript if (Keyword("try")) { retval = true; - while (Eol()); + while (Eol()) {} if (!Block()) { throw Eval_Error("Incomplete 'try' block", File_Position(line, col), filename); @@ -1215,7 +1215,7 @@ namespace chaiscript bool has_matches = true; while (has_matches) { - while (Eol()); + while (Eol()) {} has_matches = false; if (Keyword("catch", false)) { int catch_stack_top = match_stack.size(); @@ -1230,7 +1230,7 @@ namespace chaiscript } } - while (Eol()); + while (Eol()) {} if (!Block()) { throw Eval_Error("Incomplete 'catch' block", File_Position(line, col), filename); @@ -1239,11 +1239,11 @@ namespace chaiscript has_matches = true; } } - while (Eol()); + while (Eol()) {} if (Keyword("finally", false)) { int finally_stack_top = match_stack.size(); - while (Eol()); + while (Eol()) {} if (!Block()) { 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); } - while (Eol()); + while (Eol()) {} if (!Block()) { throw Eval_Error("Incomplete 'if' block", File_Position(line, col), filename); @@ -1284,7 +1284,7 @@ namespace chaiscript bool has_matches = true; while (has_matches) { - while (Eol()); + while (Eol()) {} has_matches = false; if (Keyword("else", true)) { if (Keyword("if")) { @@ -1297,7 +1297,7 @@ namespace chaiscript throw Eval_Error("Incomplete 'else if' expression", File_Position(line, col), filename); } - while (Eol()); + while (Eol()) {} if (!Block()) { throw Eval_Error("Incomplete 'else if' block", File_Position(line, col), filename); @@ -1305,7 +1305,7 @@ namespace chaiscript has_matches = true; } else { - while (Eol()); + while (Eol()) {} if (!Block()) { 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); } - while (Eol()); + while (Eol()) {} if (!Block()) { 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); } - while (Eol()); + while (Eol()) {} if (!Block()) { throw Eval_Error("Incomplete 'for' block", File_Position(line, col), filename);