From 5ad88623180d0a031512c813936f6a6bae49740c Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 26 Apr 2021 11:23:12 -0400 Subject: Source: Convince NVHPC that RAII variables are used --- Source/cmLoadCommandCommand.cxx | 9 +++++++++ Source/cmQtAutoMocUic.cxx | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 2981ef8..2456db9 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -90,6 +90,9 @@ struct LoadedCommandImpl : cmLoadedCommandInfo { if (this->Destructor) { SignalHandlerGuard guard(this->Name); +#if defined(__NVCOMPILER) + static_cast(guard); // convince compiler var is used +#endif this->Destructor(this); } if (this->Error != nullptr) { @@ -103,12 +106,18 @@ struct LoadedCommandImpl : cmLoadedCommandInfo int DoInitialPass(cmMakefile* mf, int argc, char* argv[]) { SignalHandlerGuard guard(this->Name); +#if defined(__NVCOMPILER) + static_cast(guard); // convince compiler var is used +#endif return this->InitialPass(this, mf, argc, argv); } void DoFinalPass(cmMakefile* mf) { SignalHandlerGuard guard(this->Name); +#if defined(__NVCOMPILER) + static_cast(guard); // convince compiler var is used +#endif this->FinalPass(this, mf); } }; diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx index e2b1ae1..f5c195f 100644 --- a/Source/cmQtAutoMocUic.cxx +++ b/Source/cmQtAutoMocUic.cxx @@ -2723,6 +2723,9 @@ void cmQtAutoMocUicT::CreateParseJobs(SourceFileMapT const& sourceMap) std::string cmQtAutoMocUicT::CollapseFullPathTS(std::string const& path) const { std::lock_guard guard(this->CMakeLibMutex_); +#if defined(__NVCOMPILER) + static_cast(guard); // convince compiler var is used +#endif return cmSystemTools::CollapseFullPath(path, this->ProjectDirs().CurrentSource); } @@ -2962,6 +2965,9 @@ std::vector cmQtAutoMocUicT::dependenciesFromDepFile( const char* filePath) { std::lock_guard guard(this->CMakeLibMutex_); +#if defined(__NVCOMPILER) + static_cast(guard); // convince compiler var is used +#endif auto const content = cmReadGccDepfile(filePath); if (!content || content->empty()) { return {}; -- cgit v0.12