From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17965 invoked by alias); 19 Aug 2003 21:57:01 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17951 invoked from network); 19 Aug 2003 21:57:00 -0000 Received: from unknown (HELO zenia.home) (12.223.225.216) by sources.redhat.com with SMTP; 19 Aug 2003 21:57:00 -0000 Received: by zenia.home (Postfix, from userid 5433) id 43645202C8; Tue, 19 Aug 2003 16:58:13 -0500 (EST) To: Michael Elizabeth Chastain Cc: ac131313@redhat.com, drow@mvista.com, ezannoni@redhat.com, gdb-patches@sources.redhat.com, msnyder@redhat.com Subject: Re: [rfa] save space by using enum bitfields References: <200308191938.h7JJcED0023548@duracef.shout.net> From: Jim Blandy Date: Tue, 19 Aug 2003 21:57:00 -0000 In-Reply-To: <200308191938.h7JJcED0023548@duracef.shout.net> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-08/txt/msg00326.txt.bz2 Michael Elizabeth Chastain writes: > Rats, I found a bug in my patch. Too bad you didn't approve it > before I found the bug. :) > > The bug is that the old code has some of this: > > struct minimal_symbol > { > ... > enum minimal_symbol_type { ... } type BYTE_BITFIELD; > ... > }; > > My patch has this: > > struct minimal_symbol > { > ... > enum minimal_symbol_type { ... }; > BITFIELD_ENUM(minimal_symbol_type) type : 8 > ... > }; > > gcc 3.3.1 emits warnings for the declaration of enum inside struct. > And gcc 3.2-7-rh emits errors for this! I did notice that, actually, and went looking through the ISO C spec to see whether it was kosher. ISO C says that there are only four kinds of scope: function, block, file, and prototype. So those enums should have file scope, which is what you want. But if GCC doesn't like it, okay. *shrug*