Skip to content

Commit 2bca0a5

Browse files
committed
Merge #1241: build: Improve SECP_TRY_APPEND_DEFAULT_CFLAGS macro
3addb4c build: Improve `SECP_TRY_APPEND_DEFAULT_CFLAGS` macro (Hennadii Stepanov) Pull request description: ACKs for top commit: real-or-random: utACK 3addb4c jonasnick: ACK 3addb4c Tree-SHA512: 918d906570d82be9354fba72bb55d50b8f661cf7cd4404dc244deb489c2bca95b3942ae8af830873ba825dc8ddc68b99c973fc984ff13fdd1f6668f412ca56a3
2 parents afd8b23 + 3addb4c commit 2bca0a5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

configure.ac

+7-4
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,14 @@ esac
9393
AC_DEFUN([SECP_TRY_APPEND_DEFAULT_CFLAGS], [
9494
# GCC and compatible (incl. clang)
9595
if test "x$GCC" = "xyes"; then
96-
# Try to append -Werror=unknown-warning-option to CFLAGS temporarily. Otherwise clang will
97-
# not error out if it gets unknown warning flags and the checks here will always succeed
98-
# no matter if clang knows the flag or not.
96+
# Try to append -Werror to CFLAGS temporarily. Otherwise checks for some unsupported
97+
# flags will succeed.
98+
# Note that failure to append -Werror does not necessarily mean that -Werror is not
99+
# supported. The compiler may already be warning about something unrelated, for example
100+
# about some path issue. If that is the case, -Werror cannot be used because all
101+
# of those warnings would be turned into errors.
99102
SECP_TRY_APPEND_DEFAULT_CFLAGS_saved_CFLAGS="$CFLAGS"
100-
SECP_TRY_APPEND_CFLAGS([-Werror=unknown-warning-option], CFLAGS)
103+
SECP_TRY_APPEND_CFLAGS([-Werror], CFLAGS)
101104
102105
SECP_TRY_APPEND_CFLAGS([-std=c89 -pedantic -Wno-long-long -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef], $1) # GCC >= 3.0, -Wlong-long is implied by -pedantic.
103106
SECP_TRY_APPEND_CFLAGS([-Wno-overlength-strings], $1) # GCC >= 4.2, -Woverlength-strings is implied by -pedantic.

0 commit comments

Comments
 (0)