summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-05 09:41:07 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-05 10:10:59 +0900
commit5bde2e61db8148cd5a7974f640aee38be60bf368 (patch)
treea950f30353e05fa93f983ff5166915759e40f0b7 /configure.ac
parent44cff500a0ad565952e84935bc98523c36a91b06 (diff)
Workaround for gcc-4 bug
False positive `-Wundef` in `#elif` after `#if defined`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4459
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 12 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 6605939eac..2d11169728 100644
--- a/configure.ac
+++ b/configure.ac
@@ -627,7 +627,6 @@ AS_CASE(["$GCC:${warnflags+set}:${extra_warnflags:+set}:"],
-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}:"],
])
])
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}"])