diff --git a/Makefile b/Makefile index e658955e2..a8f14bc2e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # This file is generated by tools/dmake, do not edit. ifndef CXXFLAGS - CXXFLAGS=-Wall -Wextra -Wshadow -pedantic -Wno-long-long -Wfloat-equal -Wcast-qual -Wsign-conversion -Wconversion -g + CXXFLAGS=-Wall -Wextra -Wshadow -pedantic -Wno-long-long -Wfloat-equal -Wcast-qual -Wsign-conversion -g endif ifndef CXX diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index 4baeb9a97..70d83ccda 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -122,7 +122,7 @@ private: Settings settings; CmdLineParser parser(&settings); ASSERT(parser.ParseFromArgs(2, argv)); - ASSERT_EQUALS(1, parser.GetPathNames().size()); + ASSERT_EQUALS(1, (int)parser.GetPathNames().size()); ASSERT_EQUALS("file.cpp", parser.GetPathNames().at(0)); } @@ -133,7 +133,7 @@ private: Settings settings; CmdLineParser parser(&settings); ASSERT(parser.ParseFromArgs(2, argv)); - ASSERT_EQUALS(1, parser.GetPathNames().size()); + ASSERT_EQUALS(1, (int)parser.GetPathNames().size()); ASSERT_EQUALS("src", parser.GetPathNames().at(0)); } @@ -144,7 +144,7 @@ private: Settings settings; CmdLineParser parser(&settings); ASSERT_EQUALS(false, parser.ParseFromArgs(2, argv)); - ASSERT_EQUALS(0, parser.GetPathNames().size()); + ASSERT_EQUALS(0, (int)parser.GetPathNames().size()); } void verboseshort() diff --git a/test/testerrorlogger.cpp b/test/testerrorlogger.cpp index 98688a852..69024baa6 100644 --- a/test/testerrorlogger.cpp +++ b/test/testerrorlogger.cpp @@ -63,7 +63,7 @@ private: std::list locs; locs.push_back(loc); ErrorMessage msg(locs, Severity::error, "Programming error.", "errorId"); - ASSERT_EQUALS(1, msg._callStack.size()); + ASSERT_EQUALS(1, (int)msg._callStack.size()); ASSERT_EQUALS("Programming error.", msg.shortMessage()); ASSERT_EQUALS("Programming error.", msg.verboseMessage()); ASSERT_EQUALS("[foo.cpp:5]: (error) Programming error.", msg.toString(false)); @@ -78,7 +78,7 @@ private: std::list locs; locs.push_back(loc); ErrorMessage msg(locs, Severity::error, "Programming error.\nVerbose error", "errorId"); - ASSERT_EQUALS(1, msg._callStack.size()); + ASSERT_EQUALS(1, (int)msg._callStack.size()); ASSERT_EQUALS("Programming error.", msg.shortMessage()); ASSERT_EQUALS("Verbose error", msg.verboseMessage()); ASSERT_EQUALS("[foo.cpp:5]: (error) Programming error.", msg.toString(false)); @@ -93,7 +93,7 @@ private: std::list locs; locs.push_back(loc); ErrorMessage msg(locs, Severity::error, "Programming error.\nVerbose error", "errorId"); - ASSERT_EQUALS(1, msg._callStack.size()); + ASSERT_EQUALS(1, (int)msg._callStack.size()); ASSERT_EQUALS("Programming error.", msg.shortMessage()); ASSERT_EQUALS("Verbose error", msg.verboseMessage()); ASSERT_EQUALS("foo.cpp:5,error,errorId,Programming error.", msg.toString(false, "{file}:{line},{severity},{id},{message}")); @@ -108,7 +108,7 @@ private: std::list locs; locs.push_back(loc); ErrorMessage msg(locs, Severity::error, "Programming error.\nVerbose error", "errorId"); - ASSERT_EQUALS(1, msg._callStack.size()); + ASSERT_EQUALS(1, (int)msg._callStack.size()); ASSERT_EQUALS("Programming error.", msg.shortMessage()); ASSERT_EQUALS("Verbose error", msg.verboseMessage()); ASSERT_EQUALS("Programming error. - foo.cpp(5):(error,errorId)", msg.toString(false, "{message} - {file}({line}):({severity},{id})")); diff --git a/test/testfilelister_unix.cpp b/test/testfilelister_unix.cpp index edd107860..f68f5ba27 100644 --- a/test/testfilelister_unix.cpp +++ b/test/testfilelister_unix.cpp @@ -42,7 +42,7 @@ private: ful.recursiveAddFiles2(relative, absolute, "."); ASSERT(relative.size() != 0); - ASSERT_EQUALS(relative.size(), absolute.size()); + ASSERT_EQUALS((int)relative.size(), (int)absolute.size()); for (std::vector::const_iterator r = relative.begin(), r_end = relative.end(), a = absolute.begin(), a_end = absolute.end(); diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 13fd28e29..6ba712950 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -1070,7 +1070,7 @@ private: preprocessor.preprocess(istr, actual, "file.c"); // Compare results.. - ASSERT_EQUALS(1, actual.size()); + ASSERT_EQUALS(1, (int)actual.size()); ASSERT_EQUALS("\n\na1;\n\n", actual[""]); } @@ -1088,7 +1088,7 @@ private: preprocessor.preprocess(istr, actual, "file.c"); // Compare results.. - ASSERT_EQUALS(1, actual.size()); + ASSERT_EQUALS(1, (int)actual.size()); ASSERT_EQUALS("\n\n", actual[""]); } @@ -1107,7 +1107,7 @@ private: preprocessor.preprocess(istr, actual, "file.c"); // Compare results.. - ASSERT_EQUALS(1, actual.size()); + ASSERT_EQUALS(1, (int)actual.size()); ASSERT_EQUALS("\nabc\n\n", actual[""]); } @@ -1163,7 +1163,7 @@ private: preprocessor.preprocess(istr, actual, "file.c"); // Compare results.. - ASSERT_EQUALS(1, actual.size()); + ASSERT_EQUALS(1, (int)actual.size()); ASSERT_EQUALS("\n\n\n", actual[""]); // the "defined(DEF_10) || defined(DEF_11)" are not handled correctly.. @@ -2229,7 +2229,7 @@ private: // Compare results.. ASSERT_EQUALS("\n\n\n\nB\n\n", actual[""]); - ASSERT_EQUALS(1, actual.size()); + ASSERT_EQUALS(1, (int)actual.size()); } { @@ -2247,7 +2247,7 @@ private: // Compare results.. ASSERT_EQUALS("\n\n1\n\n", actual[""]); - ASSERT_EQUALS(1, actual.size()); + ASSERT_EQUALS(1, (int)actual.size()); } { @@ -2265,7 +2265,7 @@ private: // Compare results.. ASSERT_EQUALS("\n\n1\n\n", actual[""]); - ASSERT_EQUALS(1, actual.size()); + ASSERT_EQUALS(1, (int)actual.size()); } { @@ -2283,7 +2283,7 @@ private: // Compare results.. ASSERT_EQUALS("\n\n1\n\n", actual[""]); - ASSERT_EQUALS(1, actual.size()); + ASSERT_EQUALS(1, (int)actual.size()); } } @@ -2304,7 +2304,7 @@ private: // Compare results.. ASSERT_EQUALS("\n\n\n\n", actual[""]); TODO_ASSERT_EQUALS(1, actual.size()); - ASSERT_EQUALS(2, actual.size()); + ASSERT_EQUALS(2, (int)actual.size()); } void define_ifndef2() @@ -2347,7 +2347,7 @@ private: preprocessor.preprocess(istr, actual, "file.c"); // Compare results.. - ASSERT_EQUALS(4U, actual.size()); + ASSERT_EQUALS(4, (int)actual.size()); ASSERT(actual.find("") != actual.end()); ASSERT(actual.find("BAR") != actual.end()); ASSERT(actual.find("FOO") != actual.end()); @@ -2370,7 +2370,7 @@ private: // Compare results.. ASSERT_EQUALS("char a[] = \"#endfile\";\nchar b[] = \"#endfile\";\n\n", actual[""]); - ASSERT_EQUALS(1, actual.size()); + ASSERT_EQUALS(1, (int)actual.size()); } }; diff --git a/test/testtoken.cpp b/test/testtoken.cpp index 7a5642559..eed17fc60 100644 --- a/test/testtoken.cpp +++ b/test/testtoken.cpp @@ -96,16 +96,16 @@ private: Token tok(0); tok.str("\"\""); - ASSERT_EQUALS(0, Token::getStrLength(&tok)); + ASSERT_EQUALS(0, (int)Token::getStrLength(&tok)); tok.str("\"test\""); - ASSERT_EQUALS(4, Token::getStrLength(&tok)); + ASSERT_EQUALS(4, (int)Token::getStrLength(&tok)); tok.str("\"test \\\\test\""); - ASSERT_EQUALS(10, Token::getStrLength(&tok)); + ASSERT_EQUALS(10, (int)Token::getStrLength(&tok)); tok.str("\"a\\0\""); - ASSERT_EQUALS(1, Token::getStrLength(&tok)); + ASSERT_EQUALS(1, (int)Token::getStrLength(&tok)); } void strValue() diff --git a/tools/dmake.cpp b/tools/dmake.cpp index 3083bbf21..1b34a109a 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -184,6 +184,7 @@ int main(int argc, char **argv) { // TODO: add more compiler warnings. // -Wlogical-op : doesn't work on older GCC + // -Wconversion : too many warnings // The _GLIBCXX_DEBUG doesn't work in cygwin makeConditionalVariable(fout, "CXXFLAGS", @@ -195,7 +196,7 @@ int main(int argc, char **argv) "-Wfloat-equal " "-Wcast-qual " "-Wsign-conversion " - "-Wconversion " +// "-Wconversion " "-g"); } makeConditionalVariable(fout, "CXX", "g++");