Skip to content

Commit 8b75fa0

Browse files
committed
build: Fix warnings in x86_64 assembly check
This change fixes: - `-Wuninitialized` in both Autotools and CMake; - `-Wreturn-type` in CMake only.
1 parent 10dab90 commit 8b75fa0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build-aux/m4/bitcoin_secp.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AC_DEFUN([SECP_X86_64_ASM_CHECK],[
33
AC_MSG_CHECKING(for x86_64 assembly availability)
44
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
55
#include <stdint.h>]],[[
6-
uint64_t a = 11, tmp;
6+
uint64_t a = 11, tmp = 0;
77
__asm__ __volatile__("movq \@S|@0x100000000,%1; mulq %%rsi" : "+a"(a) : "S"(tmp) : "cc", "%rdx");
88
]])], [has_x86_64_asm=yes], [has_x86_64_asm=no])
99
AC_MSG_RESULT([$has_x86_64_asm])

cmake/CheckX86_64Assembly.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ function(check_x86_64_assembly)
66
77
int main()
88
{
9-
uint64_t a = 11, tmp;
9+
uint64_t a = 11, tmp = 0;
1010
__asm__ __volatile__(\"movq $0x100000000,%1; mulq %%rsi\" : \"+a\"(a) : \"S\"(tmp) : \"cc\", \"%rdx\");
11+
return 0;
1112
}
1213
" HAVE_X86_64_ASM)
1314
set(HAVE_X86_64_ASM ${HAVE_X86_64_ASM} PARENT_SCOPE)

0 commit comments

Comments
 (0)