Help me cast this!

Lars Henrik Mathiesen thorinn at diku.dk
Thu May 12 01:02:39 AEST 1988


In article <1988May6.165221.536 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
>There is still no fully portable way to say "maximally aligned pointer".
>...
>I'm not even quite sure how I would add this to the language:  one wants
>something that shares "void *"'s property of not needing explicit casts,
>while also being maximally aligned (which may not be expressible as an
>ordinary C type).  Perhaps "struct *"?  (Ugh.)

How about some `prior art' : teach lint about /*MAXALIGN*/, it knows about so
many special cases already. After all, it's not a language feature, it's a
feature of malloc(), so llib-lc is a good place for the information.
  The next problem is with compiler writers who insist on warning about such
things on compilation. They will have to put in support for /*MAXALIGN*/, and
put that in <malloc.h> (if it exists). Or use a #pragma. Or their users will
have to live with the warnings (most probable?).
--
Lars Mathiesen, DIKU, U of Copenhagen, Denmark      [uunet!]mcvax!diku!thorinn
Institute of Datalogy -- we're scientists, not engineers.



More information about the Comp.lang.c mailing list