actived Wconversion flag in Makefile and fixed almost all Warnings from gcc-4.4

This commit is contained in:
Ettl Martin 2010-08-12 19:39:19 +02:00
parent 47c776247a
commit a6be941006
3 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
CXXFLAGS=-Wall -Wextra -Wshadow -pedantic -Wno-long-long -Wfloat-equal -Wcast-qual -Wsign-conversion -g -D_GLIBCXX_DEBUG
CXXFLAGS=-Wall -Wextra -Wshadow -pedantic -Wno-long-long -Wfloat-equal -Wconversion -Wcast-qual -Wsign-conversion -g -D_GLIBCXX_DEBUG
CXX=g++
BIN=${DESTDIR}/usr/bin

View File

@ -613,7 +613,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const std::vector<std::str
for (unsigned int i = 0; i < varname.size(); ++i)
varnames += (i == 0 ? "" : " . ") + varname[i];
const unsigned char varc(varname.empty() ? 0U : (varname.size() - 1) * 2U);
const unsigned char varc(static_cast<unsigned char>(varname.empty() ? 0U : (varname.size() - 1) * 2U));
if (Token::Match(tok, "return"))
{

View File

@ -671,8 +671,8 @@ std::string Preprocessor::getdef(std::string line, bool def)
std::string::size_type pos = 0;
while ((pos = line.find(" ", pos)) != std::string::npos)
{
const unsigned char chprev = (pos > 0) ? line[pos-1] : (unsigned char)0;
const unsigned char chnext = (pos + 1 < line.length()) ? line[pos+1] : (unsigned char)0;
const unsigned char chprev(static_cast<unsigned char>((pos > 0) ? line[pos-1] : 0));
const unsigned char chnext(static_cast<unsigned char>((pos + 1 < line.length()) ? line[pos+1] : 0));
if ((std::isalnum(chprev) || chprev == '_') && (std::isalnum(chnext) || chnext == '_'))
++pos;
else