This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: No effect of -fshort-enums..is it a bug
* Andreas Schwab <schwab@suse.de> [050921 17:46]:
> "Gaurav Gautam, Noida" <gauravga@noida.hcltech.com> writes:
> > Does -fshort-enum guides the size of enumeration type or the size of
> > enumerator constant ?
> An enumerator constant is not an object, thus it has no size of its own.
> Since the enumerator constants are of type int, not the enum type,
> -fshort-enum should not have any effect on their type.
I think some warning for this case would be nice. While the value is
looks clearly definied, I think almost all cases where this is actually
used will be errors. (The same with sizeof(void), which most likely
only happens with p=malloc(sizeof(*p)) from macros).
Is there already a warning against that (I cannot find any in the info
page) or is there any chance to get such a thing implemented?
Hochachtungsvoll,
Bernhard R. Link