Cast struct * --> double * --> struct * Portable ?

John F Carr jfc at athena.mit.edu
Sat Oct 13 03:22:54 AEST 1990


In article <MEISSNER.90Oct12122323 at osf.osf.org> meissner at osf.org (Michael Meissner) writes:
>In fact if you want the
>strongest alignment requirement within ANSI, it must have a member
>whose type is `long double'.

I don't think ANSI guarantees any alignment requirements except that nothing
is less strictly aligned than (void *) and nothing is more strictly aligned 
than the return value of malloc().  I don't know of any machine which aligns
integers more strictly than doubles, but I see nothing in ANSI C to prohibit
this.

--
    John Carr (jfc at athena.mit.edu)



More information about the Comp.lang.c mailing list