aaron.ballman added reviewers: mclow.lists, ldionne. aaron.ballman added a comment. Herald added a subscriber: dexonsmith.
In D66364#1635795 <https://reviews.llvm.org/D66364#1635795>, @rsmith wrote: > In D66364#1633981 <https://reviews.llvm.org/D66364#1633981>, @aaron.ballman > wrote: > > > My motivation is for portability. _Thread_local (and all the rest) do not > > exist in C99 or earlier (or C++), so having some way to warn users of that > > is useful. I agree that we should be consistent and go with all or none, > > but my preference is for all (esp since this is a -pedantic warning class). > > > OK, if the motivation is to catch cases where people thought they were > writing portable C99 code, but they weren't then I can see this being a > useful warning. And that suggests that we should warn on all C11 `_Keywords` > when used in C99 or earlier (or in C++). And I suppose it's reasonable to > split the hair between "this is code that someone might think is valid C99" > (eg, use of `_Static_assert`) and "this is code that is using language > extensions that no-one is likely to think is valid C99" (eg, use of > `__builtin_*`). > > That said, this direction will presumably mean that we start to reject (eg) > libc++ when built with `-Wsystem-headers -pedantic-errors` (because it uses > `_Atomic` to implement `std::atomic`), which doesn't seem ideal to me. Do you > have any thoughts on that? Maybe we should change libc++ to use > `__extension__` in those instances? Adding some libc++ maintainers to see if they have opinions. `__extension__` is one option. Could we get away with push/pop disabling of the diagnostic? Or perhaps this is a situation where we should not diagnose use within a system header in the first place, because that's part of the implementation? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66364/new/ https://reviews.llvm.org/D66364 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits