Skip to content

Commit d6c1fa7

Browse files
committed
configure: Fix for clang++-8 and newer
AX_CHECK_COMPILE_FLAG fails if it is used with -Werror and the compiler raises error -Wextra-semi-stmt: configure:4224: checking whether C++ compiler accepts -mavx configure:4243: clang++-8 -c -g -O2 -Wall -Wextra -Wpedantic -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -march=native -Werror -Wno-unused-macros -mavx conftest.cpp >&5 conftest.cpp:20:3: error: empty expression statement has no effect; remove unnecessary ';' to silence this warning [-Werror,-Wextra-semi-stmt] ; ^ 1 error generated. Add -Wno-extra-semi-stmt to disable those errors if possible. Signed-off-by: Stefan Weil <[email protected]>
1 parent b753ff6 commit d6c1fa7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

configure.ac

+4-1
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,12 @@ case "${host_os}" in
111111
;;
112112
esac
113113

114+
WERROR=-Werror
115+
# The test code used by AX_CHECK_COMPILE_FLAG uses an empty statement.
116+
# clang++-8 can emit a warning for that which must be disabled.
117+
AX_CHECK_COMPILE_FLAG([-Wno-extra-semi-stmt], [WERROR="$WERROR -Wno-extra-semi-stmt"])
114118
# The test code used by AX_CHECK_COMPILE_FLAG uses macros which are unused.
115119
# That must not break the check, so disable a related warning if necessary.
116-
WERROR=-Werror
117120
AX_CHECK_COMPILE_FLAG([-Wno-unused-macros], [WERROR="$WERROR -Wno-unused-macros"])
118121

119122
## Checks for supported compiler options.

0 commit comments

Comments
 (0)