This is the mail archive of the gcc@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: gc.dg/warn-1.c failure


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.


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