Skip to content

Commit

Permalink
configure: Fix for clang++-8 and newer
Browse files Browse the repository at this point in the history
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 <sw@weilnetz.de>
  • Loading branch information
stweil committed May 20, 2019
1 parent b753ff6 commit d6c1fa7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion configure.ac
Expand Up @@ -111,9 +111,12 @@ case "${host_os}" in
;;
esac

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

## Checks for supported compiler options.
Expand Down

0 comments on commit d6c1fa7

Please sign in to comment.