[PATCH] D150226: [Clang] Remove ability to downgrade warning on the diagnostic for setting a non fixed enum to a value outside the range of the enumeration values

Stephen Hines via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 29 12:49:12 PDT 2023


srhines added a comment.

> They'd already have had a chance to deal with their code when this was a warning-default-error without "ShowInSystemHeaders"? (or, if the yhaven't picked up a new compiler often enough, and they go from "a warning we didn't care about" to "warning-default-error-with-ShowInSystemHeaders" - they're still better off than if it'd gone straight to hard error, some chance to cleanup while disabling the warning/error before picking up a compiler version that makes it a hard error)

+1 for this. Having no intermediate step for developers to find/fix the warning in system headers (short of recompiling Clang with different settings) seems really rough for very downstream folks.

One other thought I had was whether this should have a different way to suppress a "severe" warning (i.e. `-fno-really-I-know-I-should-fix-this-UB-hole` a la the now defunct flag for automatic initialization), because it is far too common for downstream developers of all sorts to encounter a warning once, see that they just don't care about that specific instance, and then slap on a `-Wno-foo` to their project forever. It almost seems like there should be a strongly-worded opt-out for these severe warning suppressions that might be behavior-changing (even if we later remove the ability for users to suppress them). I know that compiler developers don't like adding flags (let alone confusing ones for behaviors that we know should have been strict from the start), but it seems like there might be some tradeoff here that is worth it, considering how much other downstream cleanup might be needed for some compiler vendors.


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

https://reviews.llvm.org/D150226



More information about the cfe-commits mailing list