Fix C4459: Rename a function parameter profiler_manager to avoid hiding the global declaration. (#1839)
Some checks failed
bazel / bazel.${{ matrix.os }}.${{ matrix.bzlmod && 'bzlmod' || 'no_bzlmod' }} (false, macos-latest) (push) Has been cancelled
bazel / bazel.${{ matrix.os }}.${{ matrix.bzlmod && 'bzlmod' || 'no_bzlmod' }} (false, ubuntu-latest) (push) Has been cancelled
bazel / bazel.${{ matrix.os }}.${{ matrix.bzlmod && 'bzlmod' || 'no_bzlmod' }} (false, windows-latest) (push) Has been cancelled
bazel / bazel.${{ matrix.os }}.${{ matrix.bzlmod && 'bzlmod' || 'no_bzlmod' }} (true, macos-latest) (push) Has been cancelled
bazel / bazel.${{ matrix.os }}.${{ matrix.bzlmod && 'bzlmod' || 'no_bzlmod' }} (true, ubuntu-latest) (push) Has been cancelled
bazel / bazel.${{ matrix.os }}.${{ matrix.bzlmod && 'bzlmod' || 'no_bzlmod' }} (true, windows-latest) (push) Has been cancelled
build-and-test-min-cmake / ${{ matrix.os }}.min-cmake (macos-latest) (push) Has been cancelled
build-and-test-min-cmake / ${{ matrix.os }}.min-cmake (ubuntu-latest) (push) Has been cancelled
build-and-test-perfcounters / ${{ matrix.os }}.${{ matrix.build_type }} (Debug, ubuntu-20.04) (push) Has been cancelled
build-and-test-perfcounters / ${{ matrix.os }}.${{ matrix.build_type }} (Debug, ubuntu-22.04) (push) Has been cancelled
build-and-test-perfcounters / ${{ matrix.os }}.${{ matrix.build_type }} (Release, ubuntu-20.04) (push) Has been cancelled
build-and-test-perfcounters / ${{ matrix.os }}.${{ matrix.build_type }} (Release, ubuntu-22.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, clang++, shared, macos-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, clang++, shared, ubuntu-20.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, clang++, shared, ubuntu-22.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, clang++, static, macos-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, clang++, static, ubuntu-20.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, clang++, static, ubuntu-22.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, g++, shared, macos-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, g++, shared, ubuntu-20.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, g++, shared, ubuntu-22.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, g++, static, macos-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, g++, static, ubuntu-20.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Debug, g++, static, ubuntu-22.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, clang++, shared, macos-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, clang++, shared, ubuntu-20.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, clang++, shared, ubuntu-22.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, clang++, static, macos-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, clang++, static, ubuntu-20.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, clang++, static, ubuntu-22.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, g++, shared, macos-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, g++, shared, ubuntu-20.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, g++, shared, ubuntu-22.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, g++, static, macos-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, g++, static, ubuntu-20.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }} (Release, g++, static, ubuntu-22.04) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msvc }} (x64, Debug, Visual Studio 16 2019, shared, VS-16-2019, windows-2019) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msvc }} (x64, Debug, Visual Studio 16 2019, static, VS-16-2019, windows-2019) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msvc }} (x64, Debug, Visual Studio 17 2022, shared, VS-17-2022, windows-2022) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msvc }} (x64, Debug, Visual Studio 17 2022, static, VS-17-2022, windows-2022) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msvc }} (x64, Release, Visual Studio 16 2019, shared, VS-16-2019, windows-2019) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msvc }} (x64, Release, Visual Studio 16 2019, static, VS-16-2019, windows-2019) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msvc }} (x64, Release, Visual Studio 17 2022, shared, VS-17-2022, windows-2022) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msvc }} (x64, Release, Visual Studio 17 2022, static, VS-17-2022, windows-2022) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Debug, shared, map[arch:i686 compiler:clang++ family:LLVM msystem:CLANG32], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Debug, shared, map[arch:i686 compiler:g++ family:GNU msystem:MINGW32], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Debug, shared, map[arch:x86_64 compiler:clang++ family:LLVM msystem:CLANG64], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Debug, shared, map[arch:x86_64 compiler:g++ family:GNU msystem:MINGW64], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Debug, shared, map[arch:x86_64 compiler:g++ family:GNU msystem:UCRT64], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Debug, static, map[arch:i686 compiler:clang++ family:LLVM msystem:CLANG32], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Debug, static, map[arch:i686 compiler:g++ family:GNU msystem:MINGW32], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Debug, static, map[arch:x86_64 compiler:clang++ family:LLVM msystem:CLANG64], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Debug, static, map[arch:x86_64 compiler:g++ family:GNU msystem:MINGW64], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Debug, static, map[arch:x86_64 compiler:g++ family:GNU msystem:UCRT64], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Release, shared, map[arch:i686 compiler:clang++ family:LLVM msystem:CLANG32], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Release, shared, map[arch:i686 compiler:g++ family:GNU msystem:MINGW32], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Release, shared, map[arch:x86_64 compiler:clang++ family:LLVM msystem:CLANG64], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Release, shared, map[arch:x86_64 compiler:g++ family:GNU msystem:MINGW64], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Release, shared, map[arch:x86_64 compiler:g++ family:GNU msystem:UCRT64], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Release, static, map[arch:i686 compiler:clang++ family:LLVM msystem:CLANG32], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Release, static, map[arch:i686 compiler:g++ family:GNU msystem:MINGW32], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Release, static, map[arch:x86_64 compiler:clang++ family:LLVM msystem:CLANG64], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Release, static, map[arch:x86_64 compiler:g++ family:GNU msystem:MINGW64], windows-latest) (push) Has been cancelled
build-and-test / ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }} (Release, static, map[arch:x86_64 compiler:g++ family:GNU msystem:UCRT64], windows-latest) (push) Has been cancelled
clang-format-lint / check-clang-format (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
doxygen / Build HTML documentation (push) Has been cancelled
python + Bazel pre-commit checks / pre-commit (push) Has been cancelled
sanitizer / ${{ matrix.sanitizer }}.${{ matrix.build_type }} (Debug, asan) (push) Has been cancelled
sanitizer / ${{ matrix.sanitizer }}.${{ matrix.build_type }} (Debug, msan) (push) Has been cancelled
sanitizer / ${{ matrix.sanitizer }}.${{ matrix.build_type }} (Debug, tsan) (push) Has been cancelled
sanitizer / ${{ matrix.sanitizer }}.${{ matrix.build_type }} (Debug, ubsan) (push) Has been cancelled
sanitizer / ${{ matrix.sanitizer }}.${{ matrix.build_type }} (RelWithDebInfo, asan) (push) Has been cancelled
sanitizer / ${{ matrix.sanitizer }}.${{ matrix.build_type }} (RelWithDebInfo, msan) (push) Has been cancelled
sanitizer / ${{ matrix.sanitizer }}.${{ matrix.build_type }} (RelWithDebInfo, tsan) (push) Has been cancelled
sanitizer / ${{ matrix.sanitizer }}.${{ matrix.build_type }} (RelWithDebInfo, ubsan) (push) Has been cancelled
test-bindings / Test GBM Python bindings on ${{ matrix.os }} (macos-latest) (push) Has been cancelled
test-bindings / Test GBM Python bindings on ${{ matrix.os }} (ubuntu-latest) (push) Has been cancelled
test-bindings / Test GBM Python bindings on ${{ matrix.os }} (windows-latest) (push) Has been cancelled

* Fix C4459: Rename a function parameter `profiler_manager` to avoid hiding the global declaration.

* Treat warnings as errors for MSVC

* disable one warning for MSVC
This commit is contained in:
Igor Zhukov 2024-08-19 10:39:37 +07:00 committed by GitHub
parent 6126d2a205
commit c19cfee61e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 2 deletions

View File

@ -150,6 +150,10 @@ if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
if(BENCHMARK_ENABLE_WERROR)
add_cxx_compiler_flag(-WX)
endif()
if (NOT BENCHMARK_ENABLE_EXCEPTIONS)
add_cxx_compiler_flag(-EHs-)
add_cxx_compiler_flag(-EHa-)

View File

@ -796,6 +796,11 @@ enum Skipped
} // namespace internal
#if defined(_MSC_VER)
#pragma warning(push)
// C4324: 'benchmark::State': structure was padded due to alignment specifier
#pragma warning(disable : 4324)
#endif // _MSC_VER_
// State is passed to a running Benchmark and contains state for the
// benchmark to use.
class BENCHMARK_EXPORT BENCHMARK_INTERNAL_CACHELINE_ALIGNED State {
@ -1063,6 +1068,9 @@ class BENCHMARK_EXPORT BENCHMARK_INTERNAL_CACHELINE_ALIGNED State {
friend class internal::BenchmarkInstance;
};
#if defined(_MSC_VER)
#pragma warning(pop)
#endif // _MSC_VER_
inline BENCHMARK_ALWAYS_INLINE bool State::KeepRunning() {
return KeepRunningInternal(1, /*is_batch=*/false);

View File

@ -126,14 +126,14 @@ BenchmarkReporter::Run CreateRunReport(
void RunInThread(const BenchmarkInstance* b, IterationCount iters,
int thread_id, ThreadManager* manager,
PerfCountersMeasurement* perf_counters_measurement,
ProfilerManager* profiler_manager) {
ProfilerManager* profiler_manager_) {
internal::ThreadTimer timer(
b->measure_process_cpu_time()
? internal::ThreadTimer::CreateProcessCpuTime()
: internal::ThreadTimer::Create());
State st = b->Run(iters, thread_id, &timer, manager,
perf_counters_measurement, profiler_manager);
perf_counters_measurement, profiler_manager_);
BM_CHECK(st.skipped() || st.iterations() >= st.max_iterations)
<< "Benchmark returned before State::KeepRunning() returned false!";
{