[PATCH] D120244: [clang][sema] Enable first-class bool support for C2x

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 25 14:25:22 PDT 2022


aaron.ballman added a comment.

In D120244#3538380 <https://reviews.llvm.org/D120244#3538380>, @ldionne wrote:

> We've started having several internal user complaints because their system headers are suddenly triggering a warning for using `<stdbool.h>`. This seems to be caused by the fact that `#warning` is surfaced to users even when the `#warning` is present in a system header (which makes sense, because otherwise there would be no way to issue a `#warning` from a system header). This ends up causing problems because users have no way to suppress the warning in the system headers they use without also disabling deprecation warnings in their own code. Is this intended? Instead, it seems to me like what we'd want is some way to mark the header as deprecated such that Clang will not flag uses of `<stdbool.h>` from within system headers, but will flag them from user code. This would be consistent with how the deprecated attributes work for classes and functions.
>
> Thoughts?

This is what `_CLANG_DISABLE_CRT_DEPRECATION_WARNINGS` is for. We documented it here: https://clang.llvm.org/docs/UsersManual.html#controlling-deprecation-diagnostics-in-clang-provided-c-runtime-headers but the basic idea is, if that's defined before including the header, we don't issue those warnings. Does that suffice?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120244



More information about the cfe-commits mailing list