Linux: improve tryRead macro safety

Add an explicit else clause so a following else branch for a prior if
condition does not get mixed up.

Also force a trailing semicolon and thereby silence current
-Wextra-semi-stmt warnings.

Improve readability of the hwloc_bitmap_foreach_begin loop macro.
This commit is contained in:
Christian Göttsche
2021-08-14 11:21:54 +02:00
committed by BenBE
parent ae1816e563
commit 970885edc3
2 changed files with 4 additions and 3 deletions

View File

@ -668,6 +668,7 @@ AS_VAR_IF(CACHEVAR,yes,
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS
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
AX_CHECK_COMPILE_FLAG([-Wimplicit-int-conversion], [AM_CFLAGS="$AM_CFLAGS -Wimplicit-int-conversion"], , [-Werror])
AX_CHECK_COMPILE_FLAG([-Wnull-dereference], [AM_CFLAGS="$AM_CFLAGS -Wnull-dereference"], , [-Werror])