This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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: c/6024: GCC fails to diagnose mismatch of enum types in prototype/function



> The types are compatible, which means these declarations are OK.  (Unless
> you use -fshort-enums, in which case the type in the prototype disagrees
> with the promoted type from the non-prototype definition.)


I *might* accept that argument if -Wall gave a diagnostic message for 
this.  However, I don't see why this case is any different from

struct s1 {int a, int b};
struct s2 {int c, int d};

void f(struct s1 *);

void f(x)
  struct s2 *x;
{
  return;
}

s1 and s2 are 'compatible'; but they aren't the same.  Where in the 
standard does it say that enum types are 'weak' like this?


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