From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9542 invoked by alias); 23 Sep 2005 09:16:36 -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 9376 invoked by uid 22791); 23 Sep 2005 09:16:09 -0000 Received: from pcpool00.mathematik.uni-freiburg.de (HELO pcpool00.mathematik.uni-freiburg.de) (132.230.30.150) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 23 Sep 2005 09:16:09 +0000 Received: from pcpool09.mathematik.uni-freiburg.de ([132.230.30.159]) by pcpool00.mathematik.uni-freiburg.de with asmtp (Exim 3.35 #1 (Debian)) id 1EIjf6-0002HA-00; Fri, 23 Sep 2005 11:16:08 +0200 Received: from brl by pcpool09.mathematik.uni-freiburg.de with local (Exim 4.50) id 1EIjf6-0005Xb-94; Fri, 23 Sep 2005 11:16:08 +0200 Date: Fri, 23 Sep 2005 09:16:00 -0000 From: "Bernhard R. Link" To: gcc@gcc.gnu.org, gcc-help@gcc.gnu.org Subject: Re: No effect of -fshort-enums..is it a bug Message-ID: <20050923091608.GA21181@pcpool00.mathematik.uni-freiburg.de> References: <40CC5CC7CDACC048B1299C57025E330CFD5F6C@HSDLNTD1110010.noida.hcltech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-SW-Source: 2005-09/txt/msg00163.txt.bz2 * Andreas Schwab [050921 17:46]: > "Gaurav Gautam, Noida" 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