This is the mail archive of the gcc@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: No effect of -fshort-enums..is it a bug


On Wed, Sep 21, 2005 at 05:46:58PM +0530, Gaurav Gautam, Noida wrote:
> int main()
> {
>         enum aa {
>         a = 0, b =127  , c
>         };
>  
>         printf("size = %d  %d %d\n", sizeof(a),sizeof(b), sizeof(c));
>         printf("value= %d  %d %d\n", a,b,c);
>         return 0;
> }

> The option -fshort-enums has no effect and the output is same as it is without this option.

It's not a bug.  Add sizeof(enum aa) to your printf; _that_ will be
affected by -fshort-enums.  The type of the enumerators remains int.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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