This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C ABI: "__attribute__((allow_zero_size))" update?
- From: Eddie Kohler <kohler at icir dot org>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 21 Nov 2002 09:47:51 -0800
- Subject: C ABI: "__attribute__((allow_zero_size))" update?
A thread from September ("C ABI: struct/union inconsistency",
http://gcc.gnu.org/ml/gcc/2002-09/msg01109.html) noted that the C and C++
compilers report different numbers for:
struct empty { };
printf("%d\n", sizeof(struct empty));
The proposed solution was to make "sizeof(struct empty)" 1 in both
languages, but provide an attribute like "__attribute__((allow_zero_size))"
or "tiny" or whatever that would make it 0 in both languages.
Did anyone decide on what the attribute should be called and implement the
attribute? This ABI incompatibility is currently causing me serious
problems, as I distribute a Linux kernel module written in C++.
Eddie Kohler
http://www.lcdf.org/kohler/