diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-11 20:49:07 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-11 20:49:07 +0000 |
| commit | bb7552e1167854e912b346a9f4e215990c6a1b94 (patch) | |
| tree | 9dec958ba6f36790f19139f2e488cacefa9e4b34 | |
| parent | 024023d6227739c3fb0cd61434ac86cebd75bfc8 (diff) | |
| download | ruby-bb7552e1167854e912b346a9f4e215990c6a1b94.tar.gz ruby-bb7552e1167854e912b346a9f4e215990c6a1b94.tar.xz ruby-bb7552e1167854e912b346a9f4e215990c6a1b94.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@22904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | configure.in | 17 |
2 files changed, 21 insertions, 2 deletions
@@ -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 82d1de68f..f74071703 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 |
