Re: No effect of -fshort-enums..is it a bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Andreas Schwab <schwab@xxxxxxx> [050921 17:46]:
> "Gaurav Gautam, Noida" <gauravga@xxxxxxxxxxxxxxxxx> 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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux