Files
heimdal/cf/wflags.m4
Roland C. Dowdeswell cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer.  Note that we get different
warnings on different machines and so this will be a work in
progress.  So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).

Notably, we fixed

	1.  a lot of missing structure initialisers,

	2.  unchecked return values for functions that glibc
	    marks as __attribute__((warn-unused-result)),

	3.  made minor modifications to slc and asn1_compile
	    which can generate code which generates warnings,
	    and

	4.  a few stragglers here and there.

We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g.  rsh, rcp,
popper, ftp and telnet.

Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.

We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00:00

36 lines
1023 B
Plaintext

dnl $Id$
dnl
dnl set WFLAGS
AC_DEFUN([rk_WFLAGS],[
AC_ARG_ENABLE(developer,
AS_HELP_STRING([--enable-developer], [enable developer warnings]))
if test "X$enable_developer" = Xyes; then
dwflags="-Werror"
fi
WFLAGS_NOUNUSED=""
WFLAGS_NOIMPLICITINT=""
if test -z "$WFLAGS" -a "$GCC" = "yes"; then
# -Wno-implicit-int for broken X11 headers
# leave these out for now:
# -Wcast-align doesn't work well on alpha osf/1
# -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast
# -Wmissing-declarations -Wnested-externs
# -Wstrict-overflow=5
WFLAGS="ifelse($#, 0,-Wall, $1) $dwflags"
WFLAGS_NOIMPLICITINT="-Wno-implicit-int"
#
# WFLAGS_LITE can be appended to WFLAGS to turn off a host of warnings
# that fail for various bits of older code in appl/. Let's not use it
# for the main libraries, though.
WFLAGS_LITE="-Wno-extra -Wno-missing-field-initializers -Wno-strict-aliasing -Wno-unused-result"
fi
AC_SUBST(WFLAGS)dnl
AC_SUBST(WFLAGS_LITE)dnl
AC_SUBST(WFLAGS_NOIMPLICITINT)dnl
])