tech-toolchain archive

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

Re: WARNS=5 breaks with old gcc



On Sun, Jun 24, 2012 at 06:58:07PM +1000, matthew green wrote:
> 
> > As can be seen on the NetBSD/vax -current builds, WARNS=5 does not properly
> > work with gcc 4.1.
> > 
> > Is the following patch correct?
[...]
> i'm confused.  the error at hand is about this code:
> 
> int
> getdtablesize()
> {
>         return ((int)sysconf(_SC_OPEN_MAX));
> }
> 
> compaining that it should be getdtablesize(void).  which is right.
> imo, this code should be changed instead of the warning disabled.
> 
> another question is why doesn't this trigger for gcc 4.5?  maybe
> the warning was downgraded when the prototype already has (void)
> (as unistd.h has.)

No idea why, but gcc 4.5 does not complain about old style definitions
for system headers.

njoly@petaure [~]> gcc --version
gcc (NetBSD nb2 20110806) 4.5.3
Copyright (C) 2010 Free Software Foundation,Inc.
[...]

njoly@petaure [~]> cc -Wold-style-definition -Werror -c 
/local/src/NetBSD/src/lib/libpuffs/framebuf.c
njoly@petaure [~]> echo $?
0
njoly@petaure [~]> cp /usr/include/puffs.h .
njoly@petaure [~]> cc -I. -Wold-style-definition -Werror -c 
/local/src/NetBSD/src/lib/libpuffs/framebuf.c
cc1: warnings being treated as errors
/local/src/NetBSD/src/lib/libpuffs/framebuf.c: In function 
'puffs_framebuf_make':
/local/src/NetBSD/src/lib/libpuffs/framebuf.c:103:1: error: old-style function 
definition
njoly@petaure [~]> echo $?
1

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Home | Main Index | Thread Index | Old Index