Skip to content

Commit 09ba4c1

Browse files
committed
Reapply "build: Improve '-Wextra-semi-stmt' warning option check"
The commit 97073ba was accidentally reverted by 95a1ebe. Apply the commit again. Original commit description: The '-Wunknown-warning-option' option is specific to Clang, and GCC implemented it as '-Wunknown-warning'. Rather than using '-Wunknown-warning' which is itself unportable, prevent 'extra-semi-stmt' from turning to error via the simpler '-Wno-error=extra-semi-stmt' option. Also amend the code comment to better explain why the '-Wno-error=...' option. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
1 parent c73f894 commit 09ba4c1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,11 @@ AC_DEFUN(
14541454
)
14551455
dnl AX_CHECK_COMPILE_FLAGS
14561456

1457-
AX_CHECK_COMPILE_FLAG([-Wextra-semi-stmt], [AM_CFLAGS="$AM_CFLAGS -Wextra-semi-stmt"], , [-Werror=unknown-warning-option]) dnl the autoconf check itself generates -Wextra-semi-stmt
1457+
dnl During the check of '-Wextra-semi-stmt' we must treat
1458+
dnl 'extra-semi-stmt' as a non-error because the AC_LANG_PROGRAM
1459+
dnl template will generate a warning of this (by design).
1460+
AX_CHECK_COMPILE_FLAG([-Wextra-semi-stmt], [AM_CFLAGS="$AM_CFLAGS -Wextra-semi-stmt"], , [-Werror -Wno-error=extra-semi-stmt])
1461+
14581462
AX_CHECK_COMPILE_FLAG([-Wimplicit-int-conversion], [AM_CFLAGS="$AM_CFLAGS -Wimplicit-int-conversion"], , [-Werror])
14591463
AX_CHECK_COMPILE_FLAG([-Wnull-dereference], [AM_CFLAGS="$AM_CFLAGS -Wnull-dereference"], , [-Werror])
14601464

0 commit comments

Comments
 (0)