This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]