Skip to content

Commit

Permalink
pw_preprocessor: Test GCC/Clang diagnostic modification macros
Browse files Browse the repository at this point in the history
Change-Id: I023be0c4552a41892295b2c6769973d70c9e1f07
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/231336
Pigweed-Auto-Submit: Wyatt Hepler <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Lint: Lint 🤖 <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
Reviewed-by: Carlos Chinchilla <[email protected]>
  • Loading branch information
255 authored and CQ Bot Account committed Aug 22, 2024
1 parent 80c7c74 commit a75b716
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pw_preprocessor/compiler_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,15 @@ TEST(CompilerMacros, ModifyDiagnostics) {
PW_MODIFY_DIAGNOSTICS_POP();
}

TEST(CompilerMacros, ModifyDiagnosticsClangGcc) {
PW_MODIFY_DIAGNOSTICS_PUSH();
PW_MODIFY_DIAGNOSTIC_GCC(ignored, "-Wunused-variable");
PW_MODIFY_DIAGNOSTIC_CLANG(ignored, "-Wunused-variable");

int this_variable_also_is_unused;

PW_MODIFY_DIAGNOSTICS_POP();
}

} // namespace
} // namespace pw::preprocessor

0 comments on commit a75b716

Please sign in to comment.