This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: underlying type of C++ enums [changes ABI, ok for 3.1?]
On Apr 26, 2002, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Apr 26, 2002, Jason Merrill <jason@redhat.com> wrote:
>> OK for the trunk. Mark will have to rule on the branch.
> Mark joined my paranoia :-) and approved (in private) the patch I had
> posted first (the one that tweaked cp/decl.c:finish_enum()), so I'm
> checking it in the branch, along with the following testcase.
Hmm...
Before checking it in, it occurred to me to test a similar testcase in
C and, to my surprise, the size of the enum was 4 with the enum
exactly as given, but 8 if I added foo1a = 0x7fffffffffffffffULL
between foo1 and foo2. This is another symptom of the same problem
that affected C++, so I think we have to either go with my second
patch, that implemented Jason's suggestion, or implement something
similar to what I did with C++ enums for C enums.
Mark, your call.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer