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

ruby-changes:66056

From: Nobuyoshi <ko1@a...>
Date: Wed, 5 May 2021 10:11:11 +0900 (JST)
Subject: [ruby-changes:66056] 5bde2e61db (master): Workaround for gcc-4 bug

https://git.ruby-lang.org/ruby.git/commit/?id=5bde2e61db

From 5bde2e61db8148cd5a7974f640aee38be60bf368 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 5 May 2021 09:41:07 +0900
Subject: Workaround for gcc-4 bug

False positive `-Wundef` in `#elif` after `#if defined`.
---
 configure.ac | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 6605939..2d11169 100644
--- a/configure.ac
+++ b/configure.ac
@@ -627,7 +627,6 @@ AS_CASE(["$GCC:${warnflags+set}:${extra_warnflags:+set}:"], https://github.com/ruby/ruby/blob/trunk/configure.ac#L627
 		 -Werror=pointer-arith \
 		 -Werror=shorten-64-to-32 \
 		 -Werror=write-strings \
-		 -Werror=undef \
 		 -Wimplicit-fallthrough=0 \
 		 -Wmissing-noreturn \
 		 -Wno-cast-function-type \
@@ -663,6 +662,18 @@ AS_CASE(["$GCC:${warnflags+set}:${extra_warnflags:+set}:"], https://github.com/ruby/ruby/blob/trunk/configure.ac#L662
 	    ])
 	])
     done
+    AS_IF([test "$particular_werror_flags" = "yes"], [
+	wflag=-Werror=undef
+    ], [
+	wflag=-Wundef
+    ])
+    RUBY_TRY_CFLAGS($wflag, [
+	RUBY_APPEND_OPTIONS(warnflags, $wflag)
+    ], [], [
+	@%:@if !defined(RUBY_CONFIG_TEST_NEVER_DEFINED_SYMBOL)
+	@%:@elif RUBY_CONFIG_TEST_NEVER_DEFINED_SYMBOL
+	@%:@endif
+    ])
     AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag="-Wall -Wextra"],
                              [wflag=-Wall])
     RUBY_TRY_CFLAGS($wflag, [warnflags="$wflag${warnflags+ $warnflags}"])
-- 
cgit v1.1


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

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