actived Wconversion flag in Makefile and fixed almost all Warnings from gcc-4.4
This commit is contained in:
parent
47c776247a
commit
a6be941006
2
Makefile
2
Makefile
|
@ -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
|
||||
|
||||
|
|
|
@ -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"))
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue