This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/6024: GCC fails to diagnose mismatch of enum types in prototype/function
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Cc: rearnsha at arm dot com, gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Mar 2002 11:30:58 +0000
- Subject: Re: c/6024: GCC fails to diagnose mismatch of enum types in prototype/function
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> 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?