[libcxx-commits] [PATCH] D119295: [libc++] Guard warning pragmas

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 14 09:53:12 PST 2022


philnik added inline comments.


================
Comment at: libcxx/src/hash.cpp:14
 
-#ifdef __clang__
-#pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare"
-#endif
+_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wtautological-constant-out-of-range-compare")
 
----------------
Quuxplusone wrote:
> I'd like this to be scoped with PUSH and POP too, right around the lines that actually trigger the diagnostic. But what you've got here preserves the current (suboptimal) behavior, and finding out which lines trigger the diagnostic might be a research project, I dunno, so no action //required// here (but I think it'd be //nice to have//).
I will probably look into making the scope for the diagnostic suppression smaller, but not in this PR.


================
Comment at: libcxx/src/locale.cpp:5202
+
+_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-field-initializers")
 
----------------
ldionne wrote:
> Don't we need to also add `_LIBCPP_GCC_DIAGNOSTIC_IGNORED`? In the "before" diff, there were branches for both GCC and Clang. But don't add it if it's not necessary!
I get no warnings from GCC, so I guess the warning is currently not enable for GCC. We can add the warning suppression again if we decide to enable the warning for GCC. But right now I want GCC to be able to build libc++ with `-Werror`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119295/new/

https://reviews.llvm.org/D119295



More information about the libcxx-commits mailing list