Determing alignment of (char *) pointer

rjk at mrstve.UUCP rjk at mrstve.UUCP
Wed Dec 10 23:31:09 AEST 1986


In article <7381 at utzoo.UUCP> henry at utzoo.UUCP (Henry Spencer) writes:
>> In particular, I need to determine whether the pointer is 32-bit
>> aligned before attempting to store a long by casting it to a (long *).
>
>Speaking generally, "there ain't no graceful way".
> [and so forth]

Should there be?  I may very well be misunderstanding what's going on here,
but it appears to me that you're looking for a *machine-independent* way of
performing a *machine-specific* operation.  None of the methods I've seen
(I may have missed a few) would work on a machine like the CDC 6600
(famous in song and story) with its 60 bit words.  Am I right? or have I
missed something?  Our news feed is occasionally flakey...
-- 
Rich Kuhns		{ihnp4, decvax, etc...}!pur-ee!pur-phy!mrstve!rjk



More information about the Comp.lang.c mailing list