This is the mail archive of the gdb-patches@sourceware.org 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: [ANNOUNCEMENT] GDB 7.6 released!


> > I am wondering why we are not seeing this on other platforms...
> 
> Probably because I was using a _really_ old compiler (3.4.2) on the
> machine where I saw this.

This would suggest that I misunderstood the C standard regarding
enum types. I thought that the size of a C enum was determined
by the number of enumerators (ie just large enough to fit), which
would mean that the compiler would need the full enum definition
before being able to determine how to pass that enum in a function
call. But the reference draft I have says:

    | Each enumerated type shall be compatible with an integer type. The
    | choice of type is implementation-defined,97) but shall be capable of
    | representing the values of all the members of the enumeration.

I am still a little fuzzy on what "compatible" means in terms of
constraints for the enum type. But perhaps the old compiler's
warning is overzealous; and if that's the case, I am not sure of
the value of avoiding erroneous warnings from really old compilers.

-- 
Joel


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