[Aldor-l] alignof
Stephen Watt
watt at scl.csd.uwo.ca
Fri Mar 21 17:51:33 EDT 2008
Pippijn,
Can you give an example of a compiler and input for which the macro is incorrect ?
-- Stephen
On Fri, Mar 21, 2008 at 10:43:44PM +0100, Pippijn van Steenhoven wrote:
> Hello developers and users of Aldor,
>
> I keep wondering what to do with this:
>
> # define alignof(T) (sizeof(struct {char a; T b;}) - sizeof(T))
>
> as it's incorrect. When the compiler adds padding to the structure, this
> macro may return a negative value, breaking everything.
>
> --
> Pippijn van Steenhoven
> _______________________________________________
> Aldor-l mailing list
> Aldor-l at aldor.org
> http://aldor.org/mailman/listinfo/aldor-l_aldor.org
More information about the Aldor-l
mailing list