[前][次][番号順一覧][スレッド一覧]

ruby-changes:38122

From: nobu <ko1@a...>
Date: Fri, 10 Apr 2015 11:44:19 +0900 (JST)
Subject: [ruby-changes:38122] nobu:r50203 (trunk): ext/date: reject unknown compiler option

nobu	2015-04-10 11:44:12 +0900 (Fri, 10 Apr 2015)

  New Revision: 50203

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50203

  Log:
    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.

  Modified files:
    trunk/ChangeLog
    trunk/ext/date/extconf.rb
    trunk/lib/mkmf.rb
    trunk/win32/Makefile.sub
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50202)
+++ ChangeLog	(revision 50203)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Apr 10 11:44:09 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* test/ruby/test_process.rb: unfortunately, windows is not POSIX...
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 50202)
+++ lib/mkmf.rb	(revision 50203)
@@ -621,8 +621,8 @@ MSG https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L621
     $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)
Index: win32/Makefile.sub
===================================================================
--- win32/Makefile.sub	(revision 50202)
+++ win32/Makefile.sub	(revision 50203)
@@ -208,7 +208,7 @@ WARNFLAGS = -W2 -wd4996 -we4028 -we4142 https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L208
 WARNFLAGS = -W2
 !endif
 !endif
-WERRORFLAG = -WX
+WERRORFLAG = -WX -weD9002
 !if !defined(CFLAGS)
 CFLAGS = $(RUNTIMEFLAG) $(DEBUGFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) $(COMPILERFLAG)
 !endif
Index: ext/date/extconf.rb
===================================================================
--- ext/date/extconf.rb	(revision 50202)
+++ ext/date/extconf.rb	(revision 50203)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ext/date/extconf.rb#L1
 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')

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]