Re: Implicition declarations of functions and bugs

2006-03-14 Thread Steve Greenland
On 13-Mar-06, 15:27 (CST), Ben Pfaff <[EMAIL PROTECTED]> wrote: > Steve Greenland <[EMAIL PROTECTED]> writes: > > Not if the relevant header hasn't been included. No "#include > > ", no compiler messing with "strdup()." > > You are misinformed. First, note that strdup() is not in the > standard

Re: Implicition declarations of functions and bugs

2006-03-13 Thread Ben Pfaff
Steve Greenland <[EMAIL PROTECTED]> writes: > On 12-Mar-06, 04:22 (CST), Bastian Blank <[EMAIL PROTECTED]> wrote: >> On Sat, Mar 11, 2006 at 01:43:34AM +0100, Samuel Thibault wrote: >> > This is a warning and not an error, because using one's own strdup() >> > function (that would take ints) is p

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

2006-03-13 Thread Steve Greenland
On 10-Mar-06, 20:47 (CST), David Mosberger-Tang <[EMAIL PROTECTED]> wrote: > The problem with gcc-4.0 warnings is that you can't > distinguish between harmless implicit function declarations and ones > that need to be flagged. Fix them all. There's no excuse for missing prototypes: they're trivi

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

2006-03-13 Thread Steve Greenland
On 12-Mar-06, 04:22 (CST), Bastian Blank <[EMAIL PROTECTED]> wrote: > On Sat, Mar 11, 2006 at 01:43:34AM +0100, Samuel Thibault wrote: > > This is a warning and not an error, because using one's own strdup() > > function (that would take ints) is perfectly legal. > > No, it is not. At least not w

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

2006-03-13 Thread Matthew R. Dempsky
On Sun, Mar 12, 2006 at 09:20:13PM +0100, Samuel Thibault wrote: > Matthew R. Dempsky, le Sun 12 Mar 2006 14:09:54 -0600, a écrit : > > gcc has the -fno-builtin and -fno-builtin-FUNCTION options. > > Or better, -fno-hosted and -fhosted... What makes those options better in this situation? -- T

Re: Implicition declarations of functions and bugs

2006-03-13 Thread dann frazier
On Sun, 2006-03-12 at 04:13 +0100, Goswin von Brederlow wrote: > "David Mosberger-Tang" <[EMAIL PROTECTED]> writes: > > > On 3/11/06, Goswin von Brederlow <[EMAIL PROTECTED]> wrote: > > > >> > $ gcc-3.3 -c -g -O -Wall t.c > >> > t.c: In function `foo': > >> > t.c:4: warning: implicit declaration o

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

2006-03-13 Thread Bastian Blank
On Sun, Mar 12, 2006 at 02:09:54PM -0600, Matthew R. Dempsky wrote: > gcc has the -fno-builtin and -fno-builtin-FUNCTION options. Which does not change the state of a hosted compiler. Bastian -- Schshschshchsch. -- The Gorn, "Arena", stardate 3046.2 signature.asc Description:

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

2006-03-12 Thread Samuel Thibault
Matthew R. Dempsky, le Sun 12 Mar 2006 14:09:54 -0600, a écrit : > On Sun, Mar 12, 2006 at 11:21:40AM +0100, Bastian Blank wrote: > > On Sat, Mar 11, 2006 at 01:43:34AM +0100, Samuel Thibault wrote: > > > This is a warning and not an error, because using one's own strdup() > > > function (that woul

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

2006-03-12 Thread Matthew R. Dempsky
On Sun, Mar 12, 2006 at 11:21:40AM +0100, Bastian Blank wrote: > On Sat, Mar 11, 2006 at 01:43:34AM +0100, Samuel Thibault wrote: > > This is a warning and not an error, because using one's own strdup() > > function (that would take ints) is perfectly legal. > > No, it is not. At least not with a

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

2006-03-12 Thread Olaf van der Spek
On 3/11/06, Samuel Thibault <[EMAIL PROTECTED]> wrote: > This is a warning and not an error, because using one's own strdup() Is there any reason not to add an explicit declaration (in any case)? > function (that would take ints) is perfectly legal. gcc-4.0 emits the > warning to let the programm

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

2006-03-12 Thread Bastian Blank
On Sat, Mar 11, 2006 at 01:43:34AM +0100, Samuel Thibault wrote: > This is a warning and not an error, because using one's own strdup() > function (that would take ints) is perfectly legal. No, it is not. At least not with a compiler in hosted mode. In this mode, the compiler is allowed to have an

Re: Implicition declarations of functions and bugs

2006-03-11 Thread David Mosberger-Tang
On 3/11/06, Goswin von Brederlow <[EMAIL PROTECTED]> wrote: > By the way, does ia64 NOT map anything into the lower 4GiB address > space like alpha does? Yup. Normally, nothing gets mapped below 0x2000. --david -- Mosberger Consulting LLC, http://www.mosberger-consulting.com/

Re: Implicition declarations of functions and bugs

2006-03-11 Thread Goswin von Brederlow
"David Mosberger-Tang" <[EMAIL PROTECTED]> writes: > On 3/11/06, Goswin von Brederlow <[EMAIL PROTECTED]> wrote: > >> > $ gcc-3.3 -c -g -O -Wall t.c >> > t.c: In function `foo': >> > t.c:4: warning: implicit declaration of function `strdup' >> > t.c:4: warning: return makes pointer from integer wi

Re: Implicition declarations of functions and bugs

2006-03-11 Thread David Mosberger-Tang
On 3/11/06, Goswin von Brederlow <[EMAIL PROTECTED]> wrote: > > $ gcc-3.3 -c -g -O -Wall t.c > > t.c: In function `foo': > > t.c:4: warning: implicit declaration of function `strdup' > > t.c:4: warning: return makes pointer from integer without a cast > > (all asm is from amd64) > > 004005

Re: Implicition declarations of functions and bugs

2006-03-11 Thread Goswin von Brederlow
"David Mosberger-Tang" <[EMAIL PROTECTED]> writes: > Samuel, > > You're missing the point of the check-implicit-pointer-functions > script. 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. gcc -Wal

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

2006-03-10 Thread Samuel Thibault
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 comp

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

2006-03-10 Thread David Mosberger-Tang
Samuel, You're missing the point of the check-implicit-pointer-functions script. 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. gcc -Wall normally spits out tons of spurious warnings for 64-bit dirty

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

2006-03-10 Thread Samuel Thibault
Samuel Thibault, le Sat 11 Mar 2006 01:43:34 +0100, a écrit : > > $ gcc-3.3 -c -g -O -Wall t.c > > t.c: In function `foo': > > t.c:4: warning: implicit declaration of function `strdup' > > t.c:4: warning: return makes pointer from integer without a cast > > Because strdup() here gets an implicit >

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

2006-03-10 Thread Samuel Thibault
David Mosberger-Tang, le Fri 10 Mar 2006 17:06:22 -0700, a écrit : > I'm inclined to treat this as a gcc-4 bug. It is not. > $ cat t.c > char * > foo (char *str) > { > return strdup(str); > } > $ gcc-3.3 -c -g -O -Wall t.c > t.c: In function `foo': > t.c:4: warning: implicit declaration of func

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

2006-03-10 Thread David Mosberger-Tang
I'm inclined to treat this as a gcc-4 bug. To witness: $ cat t.c char * foo (char *str) { return strdup(str); } $ gcc-3.3 -c -g -O -Wall t.c t.c: In function `foo': t.c:4: warning: implicit declaration of function `strdup' t.c:4: warning: return makes pointer from integer without a cast gcc-4.0

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

2006-03-10 Thread Samuel Thibault
dann frazier, le Fri 10 Mar 2006 15:46:58 -0700, a écrit : > On Fri, 2006-03-10 at 00:30 +0100, [EMAIL PROTECTED] wrote: > > Hi, > > > > Ah, good. But your script misses some warnings: > > > > oss.c:83: warning: incompatible implicit declaration of built-in function > > 'strdu > > > > because o

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

2006-03-10 Thread dann frazier
On Fri, 2006-03-10 at 00:30 +0100, [EMAIL PROTECTED] wrote: > Hi, > > Ah, good. But your script misses some warnings: > > oss.c:83: warning: incompatible implicit declaration of built-in function > 'strdu > > because of "incompatible" and "built-in". Please fix ;) Thanks Samuel, Can you poin

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

2006-03-09 Thread Samuel . Thibault
Hi, Ah, good. But your script misses some warnings: oss.c:83: warning: incompatible implicit declaration of built-in function 'strdu because of "incompatible" and "built-in". Please fix ;) Regards, Samuel -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble?

Re: Re: Implicition declarations of functions and bugs

2006-03-07 Thread dann frazier
> Hi, > > On Fri, Jan 20, 2006, Samuel Thibault wrote: > > Maybe the debian policy should require > > -Werror-implicit-function-declaration in CFLAGS so as to avoid such > > issue? > > Following that path would lead to -Wall -Werror :-P > > I personally received some bug reports by Da

Re: Implicition declarations of functions and bugs

2006-01-21 Thread Loïc Minier
Hi, On Fri, Jan 20, 2006, Samuel Thibault wrote: > Maybe the debian policy should require > -Werror-implicit-function-declaration in CFLAGS so as to avoid such > issue? Following that path would lead to -Wall -Werror :-P I personally received some bug reports by Dann Frazier (dannf) f

Re: Implicition declarations of functions and bugs

2006-01-20 Thread Steve Greenland
On 20-Jan-06, 16:55 (CST), Russ Allbery <[EMAIL PROTECTED]> wrote: > Yes, and definitely maintainers should clean this up when they see it > unless they know it's safe. On the other hand, *most* of the cases of > this warning in my experience are harmless because the function returns an > int. I

Re: Implicition declarations of functions and bugs

2006-01-20 Thread Russ Allbery
Samuel Thibault <[EMAIL PROTECTED]> writes: > Kurt Roeckx, le Fri 20 Jan 2006 23:56:22 +0100, a écrit : >> But this really is the maintainer of the package that should look >> at this. I don't think it's up to the buildd's maintainers to >> go and look for this type of bugs. > Ok, but maintainer

Re: Implicition declarations of functions and bugs

2006-01-20 Thread Samuel Thibault
Kurt Roeckx, le Fri 20 Jan 2006 23:56:22 +0100, a écrit : > On Fri, Jan 20, 2006 at 11:19:58PM +0100, Samuel Thibault wrote: > > Samuel Thibault, le Fri 20 Jan 2006 23:15:11 +0100, a écrit : > > > Maybe the debian policy should require > > > -Werror-implicit-function-declaration in CFLAGS so as to

Re: Implicition declarations of functions and bugs

2006-01-20 Thread Russ Allbery
Samuel Thibault <[EMAIL PROTECTED]> writes: > In buildd logs, I could find several > test.c:3: warning: implicit declaration of function 'f' > warnings > This can be very problematic on 64bits architectures such as AMD64: Yes, and definitely maintainers should clean this up when they see it unle

Re: Implicition declarations of functions and bugs

2006-01-20 Thread Kurt Roeckx
On Fri, Jan 20, 2006 at 11:19:58PM +0100, Samuel Thibault wrote: > Samuel Thibault, le Fri 20 Jan 2006 23:15:11 +0100, a écrit : > > Maybe the debian policy should require > > -Werror-implicit-function-declaration in CFLAGS so as to avoid such > > issue? > > Or buildds could check for "implicit de

Re: Implicition declarations of functions and bugs

2006-01-20 Thread Samuel Thibault
Samuel Thibault, le Fri 20 Jan 2006 23:15:11 +0100, a écrit : > Maybe the debian policy should require > -Werror-implicit-function-declaration in CFLAGS so as to avoid such > issue? Or buildds could check for "implicit declaration of function" warnings. Regards, Samuel -- To UNSUBSCRIBE, email

Implicition declarations of functions and bugs

2006-01-20 Thread Samuel Thibault
Hi, In buildd logs, I could find several test.c:3: warning: implicit declaration of function 'f' warnings This can be very problematic on 64bits architectures such as AMD64: test.c: #include int main(void) { printf("%p\n",f(-1)); return 0; } test2.c: #include void *f(long a) {