diff --git a/ChangeLog b/ChangeLog index 5546ac5261..90f4d8232d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Dec 8 12:11:06 2011 Nobuyoshi Nakada + + * configure.in (RUBY_WERROR_FLAG): append all warning flags which + are enabled to compile, so that printf format modifiers properly + fail. [ruby-core:41351] [Bug #5679] + Thu Dec 8 07:20:15 2011 Eric Hodel * doc/re.rdoc: Document difference between match and =~, options with diff --git a/configure.in b/configure.in index c6ef53fe63..7a6dcb61f6 100644 --- a/configure.in +++ b/configure.in @@ -418,6 +418,8 @@ dnl } dnl compiler section { AC_DEFUN([RUBY_WERROR_FLAG], [dnl +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $rb_cv_warnflags" if test "${ac_c_werror_flag+set}"; then rb_c_werror_flag="$ac_c_werror_flag" else @@ -425,6 +427,8 @@ else fi ac_c_werror_flag=yes $1 +CFLAGS="$save_CFLAGS" +save_CFLAGS= if test "${rb_c_werror_flag+set}"; then ac_c_werror_flag="$rb_c_werror_flag" else @@ -432,18 +436,15 @@ else fi]) AC_DEFUN(RUBY_TRY_CFLAGS, [ - save_CFLAGS="$CFLAGS" - CFLAGS="[$]CFLAGS $1" AC_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS]) RUBY_WERROR_FLAG([ + CFLAGS="[$]CFLAGS $1" AC_TRY_COMPILE([$4], [$5], [$2 AC_MSG_RESULT(yes)], [$3 AC_MSG_RESULT(no)]) ]) - CFLAGS="$save_CFLAGS" - save_CFLAGS= ]) AC_DEFUN(RUBY_TRY_LDFLAGS, [