Re: sound/pci/asihpi/hpioctl.c:125:6: warning: cast to pointer frominteger of different size

From: H. Peter Anvin
Date: Fri Feb 08 2013 - 12:07:26 EST


On 02/08/2013 07:28 AM, Russell King - ARM Linux wrote:
>
> Whether that's safe for x86 or not, I don't know, but my suspicions are
> that it's unsafe on x86 as it's possible to refer to the various bytes/
> half-words of eax separately.
>
> So, I came to the conclusion that if x86 remains a problem, there's
> little point supporting it on ARM.
>

It is possible to access bytes separately, but gcc generally doesn't.
However, whether or not that can be relied upon safely is a tricky question.

It *is* also worth nothing that the x86 ABI does allow two words to be
returned in registers from a normal C function, simply by returning a
structure. That doesn't solve the problem at hand, though, which is how
to make a type-neutral macro which can handle doublewords...

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/