reassign 688357 libc6-dev
retitle 688357 sys/cdefs.h #defines __attribute__ to nothing without __GNUC__
kthxbye

This is not actually a bug in clang, but a bug in eglibc.  In
sys/cdefs.h, __attribute__ is #defined to nothing if __GNUC__ is not
set.  However, there are other compilers that support this syntax, such
as clang and the Intel compiler.  clang #defines __GNUC__ to 4 by
default, but this is buggy because it is not fully compatible with GCC
(see 653256).  Therefore, when using clang -U__GNUC__, my __attribute__
statements get defined to nothing, and things break.

eglibc should not do this if __clang__ is defined, because clang does
support these extensions.  You might want to consider supporting the
Intel compiler as well, although I don't much care if you decide not to.

A testcase is attached.  If you remove the #include and preprocess the
code with -U__GNUC__, the attribute stays.  If you don't, the attribute
magically disappears.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
#define DREW_SYM_PUBLIC __attribute__((visibility("default")))

#include <features.h>

DREW_SYM_PUBLIC
int foo(int x)
{
	return x;
}

Attachment: signature.asc
Description: Digital signature

Reply via email to