Skip to content

Commit fe65576

Browse files
committed
Merge #88: build: Add -Wundef
978a3d8 build: Add `-Wundef` (Hennadii Stepanov) Pull request description: This PR addresses bitcoin/bitcoin#29876 (comment): Steps to reproduce an issue: ``` $ g++ -Wundef -Wno-unused-parameter -o src/fields/libminisketch_a-generic_4bytes.o -c src/fields/generic_4bytes.cpp In file included from src/fields/generic_common_impl.h:12, from src/fields/generic_4bytes.cpp:12: src/fields/../int_utils.h:162:7: warning: "HAVE_CLZ" is not defined, evaluates to 0 [-Wundef] 162 | #elif HAVE_CLZ | ^~~~~~~~ ``` ACKs for top commit: sipa: utACK 978a3d8 theuni: utACK 978a3d8 Tree-SHA512: 75435649c5e2f9682643f83d1fed1260bcc83c617bc0f4476fbada18b8b48647681eda2e336d75be8a7fafe0dc47ef9987c9ceec917a3ee64cabce4b377f6917
2 parents 3387044 + 978a3d8 commit fe65576

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ case $host in
102102
esac
103103

104104
AX_CHECK_COMPILE_FLAG([-Wall],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"],,[[$CXXFLAG_WERROR]])
105+
AX_CHECK_COMPILE_FLAG([-Wundef], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wundef"], [], [$CXXFLAG_WERROR])
105106
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[CXXFLAGS="$CXXFLAGS -fvisibility=hidden"],[],[$CXXFLAG_WERROR])
106107

107108
if test "x$use_ccache" != "xno"; then

src/int_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static inline int CountBits(I val, int max) {
159159
}
160160
if (!ret) return 0;
161161
return index + 1;
162-
#elif HAVE_CLZ
162+
#elif defined(HAVE_CLZ)
163163
(void)max;
164164
if (val == 0) return 0;
165165
if (std::numeric_limits<unsigned>::digits >= std::numeric_limits<I>::digits) {

0 commit comments

Comments
 (0)