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
- From: Daniel Jacobowitz <drow at false dot org>
- To: "Gaurav Gautam, Noida" <gauravga at noida dot hcltech dot com>
- Cc: gcc at gcc dot gnu dot org, gcc-help at gcc dot gnu dot org
- Date: Wed, 21 Sep 2005 08:39:35 -0400
- Subject: Re: No effect of -fshort-enums..is it a bug
- References: <40CC5CC7CDACC048B1299C57025E330CFD5E40@HSDLNTD1110010.noida.hcltech.com>
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