1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* configure.in (warnflags), lib/mkmf.rb (configuration): turn

warnings into errors only for bundled extensions.
  [ruby-core:33815]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-12-31 02:46:50 +00:00
parent cf1cc4bd8b
commit 484e94a89c
3 changed files with 27 additions and 4 deletions

View file

@ -1,3 +1,9 @@
Fri Dec 31 11:46:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (warnflags), lib/mkmf.rb (configuration): turn
warnings into errors only for bundled extensions.
[ruby-core:33815]
Fri Dec 31 11:15:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/zlib/zlib.c (sizeof): zlib.h mistakenly assumes the result

View file

@ -444,10 +444,23 @@ AC_DEFUN(RUBY_TRY_LDFLAGS, [
])
if test "$GCC:${warnflags+set}:no" = yes::no; then
for wflag in -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings \
particular_werror_flags=yes
for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \
-Wno-missing-field-initializers \
-Werror=pointer-arith \
-Werror=write-strings \
-Werror=declaration-after-statement \
-Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long; do
RUBY_TRY_CFLAGS($wflag, [warnflags="${warnflags+$warnflags }$wflag"])
-Werror=shorten-64-to-32; do
test "$particular_werror_flags" = yes || wflag=`echo x$wflag | sed 's/^x-Werror=/-W/'`
ok=no
RUBY_TRY_CFLAGS($wflag, [warnflags="${warnflags+$warnflags }$wflag" ok=yes])
AS_CASE([$ok:$wflag], [no:-Werror=*], [
wflag=`echo x$wflag | sed 's/^x-Werror=/-W/'`
RUBY_TRY_CFLAGS($wflag, [
warnflags="${warnflags+$warnflags }$wflag"
particular_werror_flags=no
])
])
done
AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag=-Wextra],
[wflag=-Wall])

View file

@ -1658,6 +1658,10 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
end
possible_command = (proc {|s| s if /top_srcdir/ !~ s} unless $extmk)
extconf_h = $extconf_h ? "-DRUBY_EXTCONF_H=\\\"$(RUBY_EXTCONF_H)\\\" " : $defs.join(" ") << " "
if warnflags = CONFIG['warnflags'] and CONFIG['GCC'] == 'yes' and !$extmk
# turn warnings into errors only for bundled extensions.
warnflags = warnflags.gsub(/(?:\A|\s)-Werror=/, '\1-W')
end
mk << %{
CC = #{CONFIG['CC']}
CXX = #{CONFIG['CXX']}
@ -1672,7 +1676,7 @@ RUBY_EXTCONF_H = #{$extconf_h}
cflags = #{CONFIG['cflags']}
optflags = #{CONFIG['optflags']}
debugflags = #{CONFIG['debugflags']}
warnflags = #{CONFIG['warnflags']}
warnflags = #{warnflags}
CFLAGS = #{$static ? '' : CONFIG['CCDLFLAGS']} #$CFLAGS #$ARCH_FLAG
INCFLAGS = -I. #$INCFLAGS
DEFS = #{CONFIG['DEFS']}