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:
parent
cf1cc4bd8b
commit
484e94a89c
3 changed files with 27 additions and 4 deletions
|
@ -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>
|
Fri Dec 31 11:15:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/zlib/zlib.c (sizeof): zlib.h mistakenly assumes the result
|
* ext/zlib/zlib.c (sizeof): zlib.h mistakenly assumes the result
|
||||||
|
|
19
configure.in
19
configure.in
|
@ -444,10 +444,23 @@ AC_DEFUN(RUBY_TRY_LDFLAGS, [
|
||||||
])
|
])
|
||||||
|
|
||||||
if test "$GCC:${warnflags+set}:no" = yes::no; then
|
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 \
|
-Werror=declaration-after-statement \
|
||||||
-Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long; do
|
-Werror=shorten-64-to-32; do
|
||||||
RUBY_TRY_CFLAGS($wflag, [warnflags="${warnflags+$warnflags }$wflag"])
|
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
|
done
|
||||||
AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag=-Wextra],
|
AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag=-Wextra],
|
||||||
[wflag=-Wall])
|
[wflag=-Wall])
|
||||||
|
|
|
@ -1658,6 +1658,10 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
|
||||||
end
|
end
|
||||||
possible_command = (proc {|s| s if /top_srcdir/ !~ s} unless $extmk)
|
possible_command = (proc {|s| s if /top_srcdir/ !~ s} unless $extmk)
|
||||||
extconf_h = $extconf_h ? "-DRUBY_EXTCONF_H=\\\"$(RUBY_EXTCONF_H)\\\" " : $defs.join(" ") << " "
|
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 << %{
|
mk << %{
|
||||||
CC = #{CONFIG['CC']}
|
CC = #{CONFIG['CC']}
|
||||||
CXX = #{CONFIG['CXX']}
|
CXX = #{CONFIG['CXX']}
|
||||||
|
@ -1672,7 +1676,7 @@ RUBY_EXTCONF_H = #{$extconf_h}
|
||||||
cflags = #{CONFIG['cflags']}
|
cflags = #{CONFIG['cflags']}
|
||||||
optflags = #{CONFIG['optflags']}
|
optflags = #{CONFIG['optflags']}
|
||||||
debugflags = #{CONFIG['debugflags']}
|
debugflags = #{CONFIG['debugflags']}
|
||||||
warnflags = #{CONFIG['warnflags']}
|
warnflags = #{warnflags}
|
||||||
CFLAGS = #{$static ? '' : CONFIG['CCDLFLAGS']} #$CFLAGS #$ARCH_FLAG
|
CFLAGS = #{$static ? '' : CONFIG['CCDLFLAGS']} #$CFLAGS #$ARCH_FLAG
|
||||||
INCFLAGS = -I. #$INCFLAGS
|
INCFLAGS = -I. #$INCFLAGS
|
||||||
DEFS = #{CONFIG['DEFS']}
|
DEFS = #{CONFIG['DEFS']}
|
||||||
|
|
Loading…
Add table
Reference in a new issue