Messages in this thread | | | Date | Fri, 08 Feb 2013 09:06:52 -0800 | From | "H. Peter Anvin" <> | Subject | Re: sound/pci/asihpi/hpioctl.c:125:6: warning: cast to pointer from integer of different size |
| |
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
| |