[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
c/10360: __alignof__(double) answer 8
From: |
thoran |
Subject: |
c/10360: __alignof__(double) answer 8 |
Date: |
9 Apr 2003 08:57:24 -0000 |
>Number: 10360
>Category: c
>Synopsis: __alignof__(double) answer 8
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Apr 09 09:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Frederic De Jaeger
>Release: gcc 3.2.3
>Organization:
>Environment:
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.3/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,proto,pascal,objc,ada --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --enable-__cxa_atexit
--enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.3 20030309 (Debian prerelease)
Linux thc 2.4.20-k7 #1 Tue Jan 14 00:29:06 EST 2003 i686 unknown unknown
GNU/Linux
>Description:
__alignof__(double) answer 8. But actually, it is 4 (that's what gcc generates
for record).
Apparently the problem happened in gcc 3.0
>How-To-Repeat:
#include <stdio.h>
struct bla
{
char c;
double v;
};
void main (void)
{
struct bla b;
printf("align double %d\neffective alignement %d\n", __alignof__(double),
((char *)(&b.v)) - ((char *)(&b.c)));
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
- c/10360: __alignof__(double) answer 8,
thoran <=