aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2005-07-16 14:17:51 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2005-07-16 14:17:51 +0000
commit87fbb651f896c031ec67452dfef71000aad84458 (patch)
tree5b1768cf44367ca62e49b6efd0e18557e36b689c
parent84fc24e8a0955d26e26f81f5a393fccf69156916 (diff)
downloadgcc-87fbb651f896c031ec67452dfef71000aad84458.zip
gcc-87fbb651f896c031ec67452dfef71000aad84458.tar.gz
gcc-87fbb651f896c031ec67452dfef71000aad84458.tar.bz2
Makefile.in (WARN_CFLAGS): New.
* Makefile.in (WARN_CFLAGS): New. (.c.o): Add $(WARN_CFLAGS). * aclocal.m4: Include ../config/warnings.m4. * configure.ac: Invoke ACX_PROG_CC_WARNING_OPTS, ACX_PROG_CC_WARNING_ALMOST_PEDANTIC and ACX_PROG_CC_WARNINGS_ARE_ERRORS. * fixopts.c (initialize_opts): Fix old-style definintion. * configure: Regenerate. From-SVN: r102088
-rw-r--r--fixincludes/ChangeLog12
-rw-r--r--fixincludes/Makefile.in3
-rw-r--r--fixincludes/aclocal.m41
-rwxr-xr-xfixincludes/configure163
-rw-r--r--fixincludes/configure.ac12
-rw-r--r--fixincludes/fixopts.c2
6 files changed, 189 insertions, 4 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index 107220d..8d68b7e 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,15 @@
+2005-07-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (WARN_CFLAGS): New.
+ (.c.o): Add $(WARN_CFLAGS).
+ * aclocal.m4: Include ../config/warnings.m4.
+ * configure.ac: Invoke ACX_PROG_CC_WARNING_OPTS,
+ ACX_PROG_CC_WARNING_ALMOST_PEDANTIC and
+ ACX_PROG_CC_WARNINGS_ARE_ERRORS.
+ * fixopts.c (initialize_opts): Fix old-style definintion.
+
+ * configure: Regenerate.
+
2005-06-24 Geoffrey Keating <geoffk@geoffk.org>
* inclhack.def (AAB_darwin7_9_long_double_funcs): New.
diff --git a/fixincludes/Makefile.in b/fixincludes/Makefile.in
index 54382cc..854f6e7 100644
--- a/fixincludes/Makefile.in
+++ b/fixincludes/Makefile.in
@@ -29,6 +29,7 @@ STAMP = echo timestamp >
CC = @CC@
CFLAGS = @CFLAGS@
+WARN_CFLAGS = @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@
LDFLAGS = @LDFLAGS@
INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include
FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES)
@@ -68,7 +69,7 @@ default : all
# Now figure out from those variables how to compile and link.
.c.o:
- $(CC) -c $(CFLAGS) $(CPPFLAGS) $(FIXINC_CFLAGS) $<
+ $(CC) -c $(CFLAGS) $(WARN_CFLAGS) $(CPPFLAGS) $(FIXINC_CFLAGS) $<
# The only suffixes we want for implicit rules are .c and .o.
.SUFFIXES:
diff --git a/fixincludes/aclocal.m4 b/fixincludes/aclocal.m4
index 490df22..f7cd3ca 100644
--- a/fixincludes/aclocal.m4
+++ b/fixincludes/aclocal.m4
@@ -1,6 +1,7 @@
sinclude(../config/acx.m4)
sinclude(../config/gettext.m4)
sinclude(../config/progtest.m4)
+sinclude(../config/warnings.m4)
dnl See whether we need a declaration for a function.
dnl The result is highly dependent on the INCLUDES passed in, so make sure
diff --git a/fixincludes/configure b/fixincludes/configure
index c4b2494..4d44519 100755
--- a/fixincludes/configure
+++ b/fixincludes/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT target_noncanonical TARGET CPP EGREP MAINT LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT WARN_CFLAGS WARN_PEDANTIC WERROR target_noncanonical TARGET CPP EGREP MAINT LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -847,6 +847,7 @@ if test -n "$ac_init_help"; then
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-werror-always enable -Werror despite compiler version
--enable-twoprocess Use a separate process to apply the fixes
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
@@ -2352,6 +2353,162 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+# Figure out what compiler warnings we can enable.
+# See config/warnings.m4 for details.
+
+
+WARN_CFLAGS=
+save_CFLAGS="$CFLAGS"
+for option in -W -Wall -Wwrite-strings -Wstrict-prototypes \
+ -Wmissing-prototypes -Wold-style-definition \
+ -Wmissing-format-attribute; do
+ as_acx_Woption=`echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
+
+ echo "$as_me:$LINENO: checking whether $CC supports $option" >&5
+echo $ECHO_N "checking whether $CC supports $option... $ECHO_C" >&6
+if eval "test \"\${$as_acx_Woption+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ CFLAGS="$option"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_acx_Woption=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_acx_Woption=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_acx_Woption'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_acx_Woption'}'`" >&6
+ if test `eval echo '${'$as_acx_Woption'}'` = yes; then
+ WARN_CFLAGS="$WARN_CFLAGS${WARN_CFLAGS:+ }$option"
+fi
+
+ done
+CFLAGS="$save_CFLAGS"
+
+WARN_PEDANTIC=
+if test "$GCC" = yes; then
+ echo "$as_me:$LINENO: checking whether $CC supports -pedantic -Wno-long-long" >&5
+echo $ECHO_N "checking whether $CC supports -pedantic -Wno-long-long... $ECHO_C" >&6
+if test "${acx_cv_prog_cc_pedantic__Wno_long_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ save_CFLAGS="$CFLAGS"
+CFLAGS="-pedantic -Wno-long-long"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ acx_cv_prog_cc_pedantic__Wno_long_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+acx_cv_prog_cc_pedantic__Wno_long_long=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS="$save_CFLAGS"
+fi
+echo "$as_me:$LINENO: result: $acx_cv_prog_cc_pedantic__Wno_long_long" >&5
+echo "${ECHO_T}$acx_cv_prog_cc_pedantic__Wno_long_long" >&6
+if test $acx_cv_prog_cc_pedantic__Wno_long_long = yes; then
+ WARN_PEDANTIC="-pedantic -Wno-long-long"
+fi
+
+
+fi
+
+
+
+# Only enable with --enable-werror-always until existing warnings are
+# corrected.
+WERROR=
+# Check whether --enable-werror-always or --disable-werror-always was given.
+if test "${enable_werror_always+set}" = set; then
+ enableval="$enable_werror_always"
+
+else
+ enable_werror_always=no
+fi;
+if test $enable_werror_always = yes; then
+ WERROR=-Werror
+fi
+
+
+
# Determine the noncanonical target name, for directory use.
case ${build_alias} in
"") build_noncanonical=${build} ;;
@@ -2447,7 +2604,6 @@ _ACEOF
# Checks for header files.
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -5637,6 +5793,9 @@ s,@CPPFLAGS@,$CPPFLAGS,;t t
s,@ac_ct_CC@,$ac_ct_CC,;t t
s,@EXEEXT@,$EXEEXT,;t t
s,@OBJEXT@,$OBJEXT,;t t
+s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t
+s,@WARN_PEDANTIC@,$WARN_PEDANTIC,;t t
+s,@WERROR@,$WERROR,;t t
s,@target_noncanonical@,$target_noncanonical,;t t
s,@TARGET@,$TARGET,;t t
s,@CPP@,$CPP,;t t
diff --git a/fixincludes/configure.ac b/fixincludes/configure.ac
index 4629604..04305fe 100644
--- a/fixincludes/configure.ac
+++ b/fixincludes/configure.ac
@@ -6,6 +6,18 @@ AC_CONFIG_AUX_DIR(..)
AC_CANONICAL_SYSTEM
AC_PROG_CC
+# Figure out what compiler warnings we can enable.
+# See config/warnings.m4 for details.
+
+ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
+ -Wmissing-prototypes -Wold-style-definition \
+ -Wmissing-format-attribute])
+ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
+
+# Only enable with --enable-werror-always until existing warnings are
+# corrected.
+ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
+
# Determine the noncanonical target name, for directory use.
ACX_NONCANONICAL_TARGET
diff --git a/fixincludes/fixopts.c b/fixincludes/fixopts.c
index 55a85e9..365e27d 100644
--- a/fixincludes/fixopts.c
+++ b/fixincludes/fixopts.c
@@ -26,7 +26,7 @@ ENV_TABLE
#undef _ENV_
void
-initialize_opts ()
+initialize_opts (void)
{
static const char var_not_found[] =
#ifndef __STDC__