* 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
This commit is contained in:
nobu 2009-03-11 20:49:07 +00:00
Родитель 2b9df35cd0
Коммит ab46076e38
2 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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