Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions port/port_posix_sse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ static inline uint64_t LE_LOAD64(const uint8_t *p) {

static inline bool HaveSSE42() {
#if defined(_MSC_VER)
int cpu_info[4];
int cpu_info[4] = {};
__cpuid(cpu_info, 1);
return (cpu_info[2] & (1 << 20)) != 0;
#elif defined(__GNUC__)
unsigned int eax, ebx, ecx, edx;
unsigned int eax, ebx, ecx=0, edx;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this isn't the best way to silence this warning. :P The warning was because the compiler is smart enough to see that __cpuid can fail. it'll still work but it's ugly, better to handle the failure like Bitcoin core does?

__get_cpuid(1, &eax, &ebx, &ecx, &edx);
return (ecx & (1 << 20)) != 0;
#else
Expand Down