Fix warnings in CMake source code. Suppress warnings in Lexer and Parser files that are 'too hard' to fix.
This commit is contained in:
parent
67530409a9
commit
a9dcc7fd47
|
@ -24,6 +24,7 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
|
||||||
"Clock skew detected"
|
"Clock skew detected"
|
||||||
"remark\\(1209"
|
"remark\\(1209"
|
||||||
"stl_deque.h:1051"
|
"stl_deque.h:1051"
|
||||||
|
"(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)"
|
||||||
"Parser.cxx.*warning.*2111-D.*statement is unreachable"
|
"Parser.cxx.*warning.*2111-D.*statement is unreachable"
|
||||||
"CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element"
|
"CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element"
|
||||||
)
|
)
|
||||||
|
|
|
@ -462,11 +462,13 @@ bool cmCacheManager::SaveCache(const char* path)
|
||||||
if ( currentcwd[0] >= 'A' && currentcwd[0] <= 'Z' &&
|
if ( currentcwd[0] >= 'A' && currentcwd[0] <= 'Z' &&
|
||||||
currentcwd[1] == ':' )
|
currentcwd[1] == ':' )
|
||||||
{
|
{
|
||||||
currentcwd[0] = currentcwd[0] - 'A' + 'a';
|
// Cast added to avoid compiler warning. Cast is ok because
|
||||||
|
// value is guaranteed to fit in char by the above if...
|
||||||
|
currentcwd[0] = static_cast<char>(currentcwd[0] - 'A' + 'a');
|
||||||
}
|
}
|
||||||
cmSystemTools::ConvertToUnixSlashes(currentcwd);
|
cmSystemTools::ConvertToUnixSlashes(currentcwd);
|
||||||
this->AddCacheEntry("CMAKE_CACHEFILE_DIR", currentcwd.c_str(),
|
this->AddCacheEntry("CMAKE_CACHEFILE_DIR", currentcwd.c_str(),
|
||||||
"This is the directory where this CMakeCahe.txt"
|
"This is the directory where this CMakeCache.txt"
|
||||||
" was created", cmCacheManager::INTERNAL);
|
" was created", cmCacheManager::INTERNAL);
|
||||||
|
|
||||||
fout << "# This is the CMakeCache file.\n"
|
fout << "# This is the CMakeCache file.\n"
|
||||||
|
|
|
@ -987,8 +987,8 @@ std::string cmComputeLinkInformation::NoCaseExpression(const char* str)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret += "[";
|
ret += "[";
|
||||||
ret += tolower(*s);
|
ret += static_cast<char>(tolower(*s));
|
||||||
ret += toupper(*s);
|
ret += static_cast<char>(toupper(*s));
|
||||||
ret += "]";
|
ret += "]";
|
||||||
}
|
}
|
||||||
s++;
|
s++;
|
||||||
|
|
|
@ -589,7 +589,9 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
|
||||||
(c == '\n' && newline_consume))
|
(c == '\n' && newline_consume))
|
||||||
{
|
{
|
||||||
// This is an ASCII character that may be part of a string.
|
// This is an ASCII character that may be part of a string.
|
||||||
s += c;
|
// Cast added to avoid compiler warning. Cast is ok because
|
||||||
|
// c is guaranteed to fit in char by the above if...
|
||||||
|
s += static_cast<char>(c);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -889,7 +889,8 @@ void cmGlobalGenerator::Generate()
|
||||||
this->LocalGenerators[i]->GenerateInstallRules();
|
this->LocalGenerators[i]->GenerateInstallRules();
|
||||||
this->LocalGenerators[i]->GenerateTestFiles();
|
this->LocalGenerators[i]->GenerateTestFiles();
|
||||||
this->CMakeInstance->UpdateProgress("Generating",
|
this->CMakeInstance->UpdateProgress("Generating",
|
||||||
(i+1.0f)/this->LocalGenerators.size());
|
(static_cast<float>(i)+1.0f)/
|
||||||
|
static_cast<float>(this->LocalGenerators.size()));
|
||||||
}
|
}
|
||||||
this->SetCurrentLocalGenerator(0);
|
this->SetCurrentLocalGenerator(0);
|
||||||
|
|
||||||
|
@ -996,7 +997,8 @@ void cmGlobalGenerator::CheckLocalGenerators()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->CMakeInstance->UpdateProgress
|
this->CMakeInstance->UpdateProgress
|
||||||
("Configuring", 0.9f+0.1f*(i+1.0f)/this->LocalGenerators.size());
|
("Configuring", 0.9f+0.1f*(static_cast<float>(i)+1.0f)/
|
||||||
|
static_cast<float>(this->LocalGenerators.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(notFoundMap.size())
|
if(notFoundMap.size())
|
||||||
|
@ -1262,7 +1264,8 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg)
|
||||||
}
|
}
|
||||||
|
|
||||||
int numGen = atoi(numGenC);
|
int numGen = atoi(numGenC);
|
||||||
float prog = 0.9f*this->LocalGenerators.size()/numGen;
|
float prog = 0.9f*static_cast<float>(this->LocalGenerators.size())/
|
||||||
|
static_cast<float>(numGen);
|
||||||
if (prog > 0.9f)
|
if (prog > 0.9f)
|
||||||
{
|
{
|
||||||
prog = 0.9f;
|
prog = 0.9f;
|
||||||
|
|
|
@ -126,7 +126,7 @@ bool cmStringCommand::HandleAsciiCommand(std::vector<std::string> const& args)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string error = "Character with code ";
|
std::string error = "Character with code ";
|
||||||
error += ch;
|
error += args[cc];
|
||||||
error += " does not exist.";
|
error += " does not exist.";
|
||||||
this->SetError(error.c_str());
|
this->SetError(error.c_str());
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -266,7 +266,7 @@ int runChild2(kwsysProcess* kp,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fwrite(data, 1, length, stdout);
|
fwrite(data, 1, (size_t) length, stdout);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue