aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--configure.in17
2 files changed, 21 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fbe77028cd..52a9a2f5ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
-Thu Mar 12 05:27:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 12 05:49:05 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (warnflags): added some default flags,
+ pointer-arith, write-strings and shorten-64-to-32, but suppress
+ unused-parameter and missing-field-initializers, if possible.
* configure.in (RUBY_CHECK_HUGE): checks whether a value range is
larger than long.
diff --git a/configure.in b/configure.in
index 82d1de68f1..f74071703c 100644
--- a/configure.in
+++ b/configure.in
@@ -217,7 +217,7 @@ AC_PROG_GCC_TRADITIONAL
test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
if test "$GCC" = yes; then
linker_flag=-Wl,
- : ${optflags=-O3} ${warnflags="-Wall -Wno-parentheses"}
+ : ${optflags=-O3}
else
linker_flag=
fi
@@ -320,6 +320,21 @@ AC_SUBST(CHDIR)
dnl }
dnl compiler section {
+if test "$GCC:${warnflags+set}:no" = yes::no; then
+ save_CFLAGS="$CFLAGS"
+ for wflag in -Wno-missing-field-initializers -Wshorten-64-to-32; do
+ CFLAGS="$CFLAGS $wflag"
+ AC_MSG_CHECKING([whether $wflag is accepted])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ [warnflags="${warnflags+$warnflags }$wflag"
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)])
+ done
+ CFLAGS="$save_CFLAGS"
+ unset save_CFLAGS
+ warnflags="-Wall -Wno-unused-parameter -Wno-parentheses ${warnflags+$warnflags }-Wpointer-arith -Wwrite-strings"
+fi
+
dnl check for large file stuff
mv confdefs.h confdefs1.h
: > confdefs.h