This is the mail archive of the
gcc-prs@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: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 21 Mar 2002 11:36:03 -0000
- Subject: Re: c/6024: GCC fails to diagnose mismatch of enum types in prototype/function
- Reply-to: Richard Earnshaw <rearnsha at arm dot com>
The following reply was made to PR c/6024; it has been noted by GNATS.
From: Richard Earnshaw <rearnsha@arm.com>
To: "Joseph S. Myers" <jsm28@cam.ac.uk>
Cc: rearnsha@arm.com, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: c/6024: GCC fails to diagnose mismatch of enum types in
prototype/function
Date: Thu, 21 Mar 2002 11:30:58 +0000
> 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?