aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-10 02:44:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-10 02:44:12 +0000
commit54264f534a33abde00a7297d54f75e5cc1dee934 (patch)
tree1e94619e3ef3c67070261ca24186ce18c6ee19dd
parent14d10e054ff451f26b5e4ad658f8e44b2d0fa8dd (diff)
downloadruby-54264f534a33abde00a7297d54f75e5cc1dee934.tar.gz
ext/date: reject unknown compiler option
* ext/date/extconf.rb: check warnings. * lib/mkmf.rb (try_cflags): pass options to try_compile. * win32/Makefile.sub (WERRORFLAG): make unknown command line options an error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--ext/date/extconf.rb2
-rw-r--r--lib/mkmf.rb4
-rw-r--r--win32/Makefile.sub2
4 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f1fb122e6..052e2f1aa1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Fri Apr 10 11:44:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/date/extconf.rb: check warnings.
+
+ * lib/mkmf.rb (try_cflags): pass options to try_compile.
+
+ * win32/Makefile.sub (WERRORFLAG): make unknown command line
+ options an error.
+
Fri Apr 10 08:00:17 2015 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_process.rb: unfortunately, windows is not POSIX...
diff --git a/ext/date/extconf.rb b/ext/date/extconf.rb
index 6f479eaa26..cb346dfcd9 100644
--- a/ext/date/extconf.rb
+++ b/ext/date/extconf.rb
@@ -1,5 +1,5 @@
require 'mkmf'
-if try_cflags("-std=iso9899:1999")
+if try_cflags("-std=iso9899:1999", :werror => true)
$CFLAGS += " " << "-std=iso9899:1999"
end
create_makefile('date_core')
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 67af386bfa..ba3240d0a3 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -621,8 +621,8 @@ MSG
$CFLAGS = cflags unless ret
end
- def try_cflags(flags)
- try_compile(MAIN_DOES_NOTHING, flags)
+ def try_cflags(flags, *opts)
+ try_compile(MAIN_DOES_NOTHING, flags, *opts)
end
def with_ldflags(flags)
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index b8bd25bd31..82c8b416c7 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -208,7 +208,7 @@ WARNFLAGS = -W2 -wd4996 -we4028 -we4142
WARNFLAGS = -W2
!endif
!endif
-WERRORFLAG = -WX
+WERRORFLAG = -WX -weD9002
!if !defined(CFLAGS)
CFLAGS = $(RUNTIMEFLAG) $(DEBUGFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) $(COMPILERFLAG)
!endif