[PATCH] D24289: Add warning when assigning enums to bitfields without an explicit unsigned underlying type

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 15 08:25:28 PST 2016


aaron.ballman added a comment.

In https://reviews.llvm.org/D24289#592592, @mehdi_amini wrote:

> > So when this modification tells the developer to add 'unsigned' to their enum, they are subsequently causing a warning to occur in GCC.
> > 
> > I have commented on the bug on GCC for this (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51242#c28), but it looks unlikely to be fixed.
> > 
> > Should we go ahead and add this warning when following its instructions will cause a warning in the GCC compiler? Even though GCC is at fault here, I'm not sure what the right thing is to do.
>
> GCC seems to agree that they should fix it: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414 ; so I wouldn't consider it a blocker.
>
> But I'm not using GCC either, and I don't know what is our usual policy, so it'd be nice to have another opinion here.


We don't need to be bug-for-bug compatible with GCC unless there's a compelling reason to do so (which I don't think this is), so I think this is fine to commit, modulo the comments from @thakis regarding the false-positive rate.


https://reviews.llvm.org/D24289





More information about the cfe-commits mailing list