This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c: Bitfield fixes for PRs 3325, 3326


Joseph S. Myers wrote:-

> > +      /* Accept an enum that's equivalent to int or unsigned int.  */
> > +      && (TREE_CODE (type) != ENUMERAL_TYPE
> > +	  || TYPE_PRECISION (type) != TYPE_PRECISION (integer_type_node)))
> > +    pedwarn ("bit-field `%s' type invalid in ISO C", name);
> 
> We should get rid of this special case.  ISO C doesn't have enum
> bit-fields, we should pedwarn for them regardless of whether the type is
> compatible with int / unsigned int, rather than giving people a false
> impression of portability of their programs by deciding that, though they
> said -pedantic, they didn't really mean it.

Actually, that will give a bunch more warnings in a bootstrap, since we
use enum bitfields all over the place.  I suggest it's best to leave
this, for the moment at least.

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]