Skip to content

Commit

Permalink
pw_preprocessor: Introduce PW_MODIFY_DIAGNOSTIC_CLANG
Browse files Browse the repository at this point in the history
Complements PW_MODIFY_DIAGNOSTIC_GCC.

Fixes: b/356935569
Change-Id: I1c282ecc65c9fd0ecb88c280a31e22ed6519c82b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/231332
Presubmit-Verified: CQ Bot Account <[email protected]>
Lint: Lint 🤖 <[email protected]>
Commit-Queue: Wyatt Hepler <[email protected]>
Pigweed-Auto-Submit: Wyatt Hepler <[email protected]>
Reviewed-by: Dave Roth <[email protected]>
  • Loading branch information
255 authored and CQ Bot Account committed Aug 21, 2024
1 parent a759e7d commit ea78a58
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pw_preprocessor/public/pw_preprocessor/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@
PW_MODIFY_DIAGNOSTIC(kind, option)
#endif // __clang__

/// Applies ``PW_MODIFY_DIAGNOSTIC`` only for Clang. This is useful for warnings
/// that aren't supported by or don't need to be changed in other compilers.
#ifdef __clang__
#define PW_MODIFY_DIAGNOSTIC_CLANG(kind, option) \
PW_MODIFY_DIAGNOSTIC(kind, option)
#else
#define PW_MODIFY_DIAGNOSTIC_CLANG(kind, option) _PW_REQUIRE_SEMICOLON
#endif // __clang__

/// Expands to a `_Pragma` with the contents as a string. `_Pragma` must take a
/// single string literal; this can be used to construct a `_Pragma` argument.
#define PW_PRAGMA(contents) _Pragma(#contents)
Expand Down

0 comments on commit ea78a58

Please sign in to comment.