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: 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: 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?