This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug manual/315] documentation correction for obstack alignment
- From: "eggert at gnu dot org" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 11 Aug 2004 23:35:40 -0000
- Subject: [Bug manual/315] documentation correction for obstack alignment
- References: <20040810044513.315.eggert@gnu.org>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- Additional Comments From eggert at gnu dot org 2004-08-11 23:35 -------
DEFAULT_ALIGNMENT is the alignment of double only because of a
historical accident: when that code was originally written, the
alignment of double was the strictest for each host. The intent was
that the default alignment would suffice, and that you can specify
a stricter alignment if you know what it is.
Typical obstack usage (e.g., the GCC source code, the Bison source
code) looks like this:
#if !defined(__GNUC__) || (__GNUC__ < 2)
#define __alignof__(type) 0
#endif
obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE,
__alignof__ (bitmap_element),
obstack_chunk_alloc,
obstack_chunk_free);
and hence if GCC and/or Bison is compiled by a non-GCC compiler, the
obstack code will use the default alignment. This typical usage works
in general only if the default alignment suffices for all types.
Also please see Bugzilla Bug 321
<http://sources.redhat.com/bugzilla/show_bug.cgi?id=321>;
once that patch is installed the alignment will no longer
necessarily be that of "double".
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=315
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.