This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfa] save space by using enum bitfields


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!

So I have to do:

  enum minimal_symbol_type
  {
    ...
  };

  struct minimal_symbol
  {
    ...
    BITFIELD_ENUM(minimal_symbol_type) type : 8;
  };

I am preparing a new patch now.  It's actually shorter than the
old patch, because I gave up on struct symtab (this is not a
space critical struct and it has one of those pesky embedded
enum definitions, so it's a bunch of patching for little space
savings).

Michael C


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]