From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4997 invoked by alias); 21 Aug 2003 14:10:55 -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 4984 invoked from network); 21 Aug 2003 14:10:52 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 21 Aug 2003 14:10:52 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id EE25E2B7F; Thu, 21 Aug 2003 10:10:44 -0400 (EDT) Message-ID: <3F44D2E4.70405@redhat.com> Date: Thu, 21 Aug 2003 14:10:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Elizabeth Chastain Cc: ezannoni@redhat.com, gdb-patches@sources.redhat.com, jimb@redhat.com Subject: Re: [rfa] space reduction in gdbtypes.h References: <200308210433.h7L4XEiG018122@duracef.shout.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-08/txt/msg00363.txt.bz2 > Andrew C says: > > >> #define BOUND_BY_REF_IN_REG 2 >> #define BOUND_BY_VALUE_IN_REG 1 >> #define BOUND_SIMPLE 0 >> - int upper_bound_type; >> - int lower_bound_type; >> + int upper_bound_type : 4; >> + int lower_bound_type : 4; >> >> Hmm, doesn't this part scream ENUM? > > > I agree, it does, but I wanted to patch one thing at a time, > so I left it as an int. Try a different ordering of the changes: - make the cleanups first (no functional change) - make the functional change last (here reducing the size of the gdb footprint) >> Without that the packing is unsafe: >> adding an extra variant that overflows the field won't be detected; >> compilers capable of checking enum assignments won't do anything useful. > > > Well, the definitions are right next to the use, which would make > it obvious. People have this habit of taking shortcuts when ever possible -> it's never obvious :-( > Would you like me to go ahead and make this an enum right now? Yes please. Macro's are bad m'kay. Andrew