Skip to contentSkip to conversation

sparse error: got __int128

DISCUSSION Tony Camuso 1 participant 2 messages Jan 18, 2015 Sparse checker

lore
Share & tools
lore
#0 lore raw

Example:

drivers/acpi/processor_core.i:6109:26: error: Expected ) at end of cast operator drivers/acpi/processor_core.i:6109:26: error: got __int128

Passing a large list of files causes the error count to exceed 100, whereupon sparse exits.

The offending source is in include/linux/math64.h

#if defined(CONFIG_ARCH_SUPPORTS_INT128) && defined(__SIZEOF_INT128__)

#ifndef mul_u64_u32_shr
static inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift)

{
        return (u64)(((unsigned __int128)a * mul) >> shift);
}

#endif /* mul_u64_u32_shr */

Of course, disabling 64-bit kernel in .config removes the problem, but this is an unacceptable solution.

I can't see clearly why sparse should flag this as an error.

#1 lore raw
Quoted 3 lines · Tony Camuso

Of course, disabling 64-bit kernel in .config removes the problem, but this is
an unacceptable solution.

^^^
NOT