summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-11 20:49:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-11 20:49:07 +0000
commitab46076e3838ac8d6873999ab4f5bde6f61d4400 (patch)
tree9dec958ba6f36790f19139f2e488cacefa9e4b34 /configure.in
parent2b9df35cd0d8a4a710c9c836ed4a6abef1986221 (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in17
1 files changed, 16 insertions, 1 deletions
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