Skip to content

Commit

Permalink
Workaround for gcc-4 bug
Browse files Browse the repository at this point in the history
False positive `-Wundef` in `#elif` after `#if defined`.
  • Loading branch information
nobu committed May 5, 2021
1 parent 44cff50 commit 5bde2e6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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}"])
Expand Down

0 comments on commit 5bde2e6

Please sign in to comment.