[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re: Re: Implicition declarations of functions and bugs



Hi,

David Mosberger-Tang, le Fri 10 Mar 2006 19:47:10 -0700, a écrit :
> Its purposes is not to "grep for warnings" but instead to
> look for pairs of warnings that are *guaranteed* to cause crashes on
> 64-bit machines. 

I did understand that. And my abs() example shows that gcc-4.0 doesn't
complain is such case.

> enum e_t { a, b };
> 
> enum e_t
> bar (char *str)
> {
>   return strlen (str);
> }
> $ gcc-3.3 -c -g -O -Wall t.c
> t.c: In function `bar':
> t.c:12: warning: implicit declaration of function `strlen'
> $ gcc-4.0 -c -g -O -Wall t.c
> t.c: In function 'bar':
> t.c:12: warning: implicit declaration of function 'strlen'
> t.c:12: warning: incompatible implicit declaration of built-in function 'strlen'

That one may cause crashes too because of the str argument. It happens
that with pointers, on amd64, the compiler seems to correctly fill up
registers. But I don't know how this is and will always be true on all
64bits backends (it is not true for longs on amd64).

Well, submit the bug, and gcc people will tell us.

Regards,
Samuel



Reply to: