tech-toolchain archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
re: WARNS=5 breaks with old gcc
> 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?
>
> RCS file: /cvsroot/src/share/mk/bsd.sys.mk,v
> retrieving revision 1.215
> diff -u -r1.215 bsd.sys.mk
> --- bsd.sys.mk 20 Mar 2012 21:48:20 -0000 1.215
> +++ bsd.sys.mk 24 Jun 2012 08:26:25 -0000
> @@ -60,7 +60,7 @@
> CXXFLAGS+= ${${ACTIVE_CXX} == "gcc":? -Wno-non-template-friend
> -Wno-pmf-conversions :}
> .endif
> .if ${WARNS} > 3 && (defined(HAVE_GCC) || defined(HAVE_LLVM))
> -.if ${WARNS} > 4
> +.if ${WARNS} > 4 && (!defined(HAVE_GCC) || ${HAVE_GCC} >= 45)
> CFLAGS+= -Wold-style-definition
> .endif
> CFLAGS+= -Wsign-compare -Wformat=2
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.)
.mrg.
Home |
Main Index |
Thread Index |
Old Index