Skip to content

Commit 18b46ea

Browse files
authored
Merge pull request #1787 from Explorer09/configure-extra-semi-stmt
build: Improve `-Wextra-semi-stmt` warning option check
2 parents 79785e8 + 97073ba commit 18b46ea

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
@@ -1217,7 +1217,11 @@ AS_VAR_IF(CACHEVAR,yes,
12171217
AS_VAR_POPDEF([CACHEVAR])dnl
12181218
])dnl AX_CHECK_COMPILE_FLAGS
12191219

1220-
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
1220+
dnl During the check of '-Wextra-semi-stmt' we must treat
1221+
dnl 'extra-semi-stmt' as a non-error because the AC_LANG_PROGRAM
1222+
dnl template will generate a warning of this (by design).
1223+
AX_CHECK_COMPILE_FLAG([-Wextra-semi-stmt], [AM_CFLAGS="$AM_CFLAGS -Wextra-semi-stmt"], , [-Werror -Wno-error=extra-semi-stmt])
1224+
12211225
AX_CHECK_COMPILE_FLAG([-Wimplicit-int-conversion], [AM_CFLAGS="$AM_CFLAGS -Wimplicit-int-conversion"], , [-Werror])
12221226
AX_CHECK_COMPILE_FLAG([-Wnull-dereference], [AM_CFLAGS="$AM_CFLAGS -Wnull-dereference"], , [-Werror])
12231227

0 commit comments

Comments
 (0)