This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gc.dg/warn-1.c failure
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: Joern Rennecke <joern dot rennecke at superh dot com>, gcc at gcc dot gnu dot org
- Date: Wed, 16 Apr 2003 12:21:29 -0700
- Subject: Re: gc.dg/warn-1.c failure
- References: <3E9D8FEC.2ABDEDC5@superh.com> <jmd6jmb7ok.fsf@desire.geoffk.org>
On Wed, Apr 16, 2003 at 11:47:55AM -0700, Geoff Keating wrote:
> Joern Rennecke <joern dot rennecke at superh dot com> writes:
>
> > This test fails because the functions are no longer compiled
> > at -O3. If you remove the 'static' from the function declaration
> > you get the warning back.
> > Now, should we 'fix' the compiler to always do enough compilation
> > to emit warnings about conversions due to argument passing?
> > Or should we change the testcase so that the compiler has to compile
> > the functions?
>
> I think the testcase should be changed. IMO, there's no point making
> a special effort to warn about conversions that don't actually ever
> happen.
>
Since it is mentioned, I got
# cat f.c
extern int foo_short (short);
extern int foo_long (long);
int
foo (long *i)
{
if (0)
return foo_short ((short) i);
else
return foo_long ((long) i);
}
# gcc -c f.c
f.c: In function `foo':
f.c:7: warning: cast from pointer to integer of different size
I find it is quite annoying.
H.J.