gcc: disabled -Wconversion again - too many warnings

This commit is contained in:
Daniel Marjamäki 2011-01-01 09:16:31 +01:00
parent 68700b3561
commit a9aa6375b7
7 changed files with 26 additions and 25 deletions

View File

@ -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

View File

@ -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()

View File

@ -63,7 +63,7 @@ private:
std::list<ErrorLogger::ErrorMessage::FileLocation> 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<ErrorLogger::ErrorMessage::FileLocation> 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<ErrorLogger::ErrorMessage::FileLocation> 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<ErrorLogger::ErrorMessage::FileLocation> 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})"));

View File

@ -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<std::string>::const_iterator r = relative.begin(), r_end = relative.end(),
a = absolute.begin(), a_end = absolute.end();

View File

@ -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());
}
};

View File

@ -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()

View File

@ -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++");