1
0
mirror of https://git.tukaani.org/xz.git synced 2026-02-25 21:38:06 +00:00

liblzma/MSVC: Add a cast to fix a warning (C4057) with __cpuid()

__cpuid from MSVC (and also the old Intel ICC) use int[], while
__get_cpuid from <cpuid.h> in GCC and Clang use unsigned int[].
Adding a cast is the simplest fix.

Link: https://github.com/tukaani-project/xz/pull/208
This commit is contained in:
Radek Zikmund 2026-02-12 15:24:15 +01:00 committed by Lasse Collin
parent b51d67f4a9
commit b0f3b64a25
No known key found for this signature in database
GPG Key ID: 38EE757D69184620

View File

@ -344,7 +344,7 @@ is_arch_extension_supported(void)
#if defined(_MSC_VER)
// This needs <intrin.h> with MSVC. ICC has it as a built-in
// on all platforms.
__cpuid(r, 1);
__cpuid((int *)r, 1);
#elif defined(HAVE_CPUID_H)
// Compared to just using __asm__ to run CPUID, this also checks
// that CPUID is supported and saves and restores ebx as that is