mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-12 00:58:59 -05:00
Merge topic 'clang-scan-build-warnings'
9e4b6bcbe8Source/LexerParser: Suppress "Use of zero-allocated memory" warning613323a78bcmGlobalUnixMakefileGenerator3: Fix memory leak warningbf2503089bliblzma: fix undefined shift resultee555c2a33libuv: fix clang scan-build warning Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2796
This commit is contained in:
@@ -664,6 +664,8 @@ Modify cmCommandArgumentLexer.cxx:
|
||||
|
||||
/* IWYU pragma: no_forward_declare yyguts_t */
|
||||
|
||||
#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
|
||||
|
||||
#include "cmCommandArgumentParserHelper.h"
|
||||
|
||||
/* Replace the lexer input function. */
|
||||
@@ -2246,3 +2248,5 @@ void cmCommandArgument_SetupEscapes(yyscan_t yyscanner, bool noEscapes)
|
||||
BEGIN(ESCAPES);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __clang_analyzer__ */
|
||||
|
||||
@@ -18,6 +18,8 @@ Modify cmCommandArgumentLexer.cxx:
|
||||
|
||||
/* IWYU pragma: no_forward_declare yyguts_t */
|
||||
|
||||
#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
|
||||
|
||||
#include "cmCommandArgumentParserHelper.h"
|
||||
|
||||
/* Replace the lexer input function. */
|
||||
@@ -145,3 +147,5 @@ void cmCommandArgument_SetupEscapes(yyscan_t yyscanner, bool noEscapes)
|
||||
BEGIN(ESCAPES);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __clang_analyzer__ */
|
||||
|
||||
@@ -860,6 +860,8 @@ Modify cmDependsJavaLexer.cxx:
|
||||
|
||||
/* IWYU pragma: no_forward_declare yyguts_t */
|
||||
|
||||
#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "cmDependsJavaParserHelper.h"
|
||||
@@ -2811,3 +2813,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
|
||||
}
|
||||
|
||||
#define YYTABLES_NAME "yytables"
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* __clang_analyzer__ */
|
||||
|
||||
@@ -18,6 +18,8 @@ Modify cmDependsJavaLexer.cxx:
|
||||
|
||||
/* IWYU pragma: no_forward_declare yyguts_t */
|
||||
|
||||
#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "cmDependsJavaParserHelper.h"
|
||||
@@ -173,3 +175,7 @@ null { PRIMITIVE; return jp_NULLLITERAL; }
|
||||
}
|
||||
|
||||
%%
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* __clang_analyzer__ */
|
||||
|
||||
@@ -664,6 +664,8 @@ Modify cmExprLexer.cxx:
|
||||
|
||||
/* IWYU pragma: no_forward_declare yyguts_t */
|
||||
|
||||
#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
|
||||
|
||||
#include "cmExprParserHelper.h"
|
||||
|
||||
/* Replace the lexer input function. */
|
||||
@@ -2223,3 +2225,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
|
||||
}
|
||||
|
||||
#define YYTABLES_NAME "yytables"
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* __clang_analyzer__ */
|
||||
|
||||
@@ -18,6 +18,8 @@ Modify cmExprLexer.cxx:
|
||||
|
||||
/* IWYU pragma: no_forward_declare yyguts_t */
|
||||
|
||||
#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
|
||||
|
||||
#include "cmExprParserHelper.h"
|
||||
|
||||
/* Replace the lexer input function. */
|
||||
@@ -61,3 +63,7 @@ Modify cmExprLexer.cxx:
|
||||
. { yyextra->UnexpectedChar(yytext[0]); }
|
||||
|
||||
%%
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* __clang_analyzer__ */
|
||||
|
||||
@@ -838,6 +838,8 @@ Modify cmFortranLexer.cxx:
|
||||
|
||||
/* IWYU pragma: no_forward_declare yyguts_t */
|
||||
|
||||
#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
|
||||
|
||||
#undef YY_NO_UNPUT
|
||||
|
||||
#define cmFortranLexer_cxx
|
||||
@@ -2610,3 +2612,5 @@ YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
return YY_CURRENT_BUFFER;
|
||||
}
|
||||
|
||||
#endif /* __clang_analyzer__ */
|
||||
|
||||
@@ -27,6 +27,8 @@ Modify cmFortranLexer.cxx:
|
||||
|
||||
/* IWYU pragma: no_forward_declare yyguts_t */
|
||||
|
||||
#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
|
||||
|
||||
#undef YY_NO_UNPUT
|
||||
|
||||
#define cmFortranLexer_cxx
|
||||
@@ -183,3 +185,5 @@ YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
return YY_CURRENT_BUFFER;
|
||||
}
|
||||
|
||||
#endif /* __clang_analyzer__ */
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
#include "cmAlgorithms.h"
|
||||
#include "cmDocumentationEntry.h"
|
||||
#include "cmGeneratedFileStream.h"
|
||||
#include "cmGeneratorTarget.h"
|
||||
@@ -494,6 +495,7 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
const std::string& targetName, const std::string& /*config*/, bool fast,
|
||||
int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
std::unique_ptr<cmMakefile> mfu;
|
||||
cmMakefile* mf;
|
||||
if (!this->Makefiles.empty()) {
|
||||
mf = this->Makefiles[0];
|
||||
@@ -504,7 +506,8 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
snapshot.GetDirectory().SetCurrentBinary(
|
||||
this->CMakeInstance->GetHomeOutputDirectory());
|
||||
snapshot.SetDefaultDefinitions();
|
||||
mf = new cmMakefile(this, snapshot);
|
||||
mfu = cm::make_unique<cmMakefile>(this, snapshot);
|
||||
mf = mfu.get();
|
||||
}
|
||||
|
||||
makeCommand.push_back(this->SelectMakeProgram(makeProgram));
|
||||
@@ -529,9 +532,6 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
cmSystemTools::ConvertToOutputSlashes(tname);
|
||||
makeCommand.push_back(std::move(tname));
|
||||
}
|
||||
if (this->Makefiles.empty()) {
|
||||
delete mf;
|
||||
}
|
||||
}
|
||||
|
||||
void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
|
||||
|
||||
@@ -97,7 +97,7 @@ x86_code(void *simple_ptr, uint32_t now_pos, bool is_encoder,
|
||||
if (!Test86MSByte(b))
|
||||
break;
|
||||
|
||||
src = dest ^ ((1u << (32 - i * 8)) - 1);
|
||||
src = dest ^ ((1ull << (32 - i * 8)) - 1);
|
||||
}
|
||||
|
||||
buffer[buffer_pos + 4]
|
||||
|
||||
@@ -334,7 +334,7 @@ static void uv__process_child_init(const uv_process_options_t* options,
|
||||
use_fd = open("/dev/null", fd == 0 ? O_RDONLY : O_RDWR);
|
||||
close_fd = use_fd;
|
||||
|
||||
if (use_fd == -1) {
|
||||
if (use_fd < 0) {
|
||||
uv__write_int(error_fd, UV__ERR(errno));
|
||||
_exit(127);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user