Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Michael Elizabeth Chastain <mec@shout.net>
Cc: ezannoni@redhat.com, gdb-patches@sources.redhat.com, jimb@redhat.com
Subject: Re: [rfa] space reduction in gdbtypes.h
Date: Thu, 21 Aug 2003 14:10:00 -0000	[thread overview]
Message-ID: <3F44D2E4.70405@redhat.com> (raw)
In-Reply-To: <200308210433.h7L4XEiG018122@duracef.shout.net>

> 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


  reply	other threads:[~2003-08-21 14:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-21  4:33 Michael Elizabeth Chastain
2003-08-21 14:10 ` Andrew Cagney [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-08-20 23:02 Michael Elizabeth Chastain
2003-08-20 20:23 Michael Elizabeth Chastain
2003-08-20 17:46 Michael Elizabeth Chastain
2003-08-20 19:55 ` Jim Blandy
2003-08-21  4:04 ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F44D2E4.70405@redhat.com \
    --to=ac131313@redhat.com \
    --cc=ezannoni@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.com \
    --cc=mec@shout.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox