bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module 'stdalign'


From: Bruno Haible
Subject: Re: new module 'stdalign'
Date: Fri, 29 Jul 2011 01:47:02 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

Hi Sam,

> 1. There is already alignof module - is this a replacement?

It is not exactly a replacement, because there are two possible notions of
alignof - the necessary alignment and the optimal alignment [1]-, and while
alignof.h favors the optimal alignment, I think that <stdalign.h> favors
the necessary alignment. This is one of the problems that need to be dealt
with when adding this module to gnulib.

> 2. alignof.h uses offsetof macro - where is it defined?

It is defined in <stddef.h>. This is portable. No platform exists with
known portability problems.

> 3. clisp/src/lispbibl.d defines offsetof, offsetofa, alignof - which
>    gnulib modules should they be imported from? (or should I just leave
>    them defined in clisp?)

For offsetof, clisp could rely on <stddef.h>. offsetofa is a clisp invention.
For alignof, whether you want to use gnulib's <alignof.h> depends on what you
need - the necessary alignment and the optimal alignment.

Bruno

[1] See the comments in lib/alignof.h.
-- 
In memoriam Stjepan Đureković <http://en.wikipedia.org/wiki/Stjepan_Đureković>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]