From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32658 invoked by alias); 21 Sep 2005 12:39:47 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 32454 invoked by uid 22791); 21 Sep 2005 12:39:37 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 21 Sep 2005 12:39:37 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1EI3st-0008Rx-Lw; Wed, 21 Sep 2005 08:39:35 -0400 Date: Wed, 21 Sep 2005 12:39:00 -0000 From: Daniel Jacobowitz To: "Gaurav Gautam, Noida" Cc: gcc@gcc.gnu.org, gcc-help@gcc.gnu.org Subject: Re: No effect of -fshort-enums..is it a bug Message-ID: <20050921123934.GA32407@nevyn.them.org> Mail-Followup-To: "Gaurav Gautam, Noida" , gcc@gcc.gnu.org, gcc-help@gcc.gnu.org References: <40CC5CC7CDACC048B1299C57025E330CFD5E40@HSDLNTD1110010.noida.hcltech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40CC5CC7CDACC048B1299C57025E330CFD5E40@HSDLNTD1110010.noida.hcltech.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-09/txt/msg00136.txt.bz2 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