https://bugs.llvm.org/show_bug.cgi?id=34319
Bug ID: 34319
Summary: Attribute names enclosed by __ are sometimes rejected
Product: clang
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangb...@nondot.org
Reporter: sebastian.hu...@embedded-brains.de
CC: llvm-bugs@lists.llvm.org
>From the GCC documentation we have
https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax
"You may optionally specify attribute names with ‘__’ preceding and following
the name. This allows you to use them in header files without being concerned
about a possible macro of the same name. For example, you may use the attribute
name __noreturn__ instead of noreturn."
It would be nice if this is also supported by clang, e.g. for use in standard C
library header files. We have for example:
void f0(void) __attribute__((noreturn));
void f1(void) __attribute__((__noreturn__));
void f2(int *l) __attribute__((exclusive_lock_function(*l)));
void f3(int *l) __attribute__((__exclusive_lock_function__(*l)));
Which yields:
clang -c test.c
test.c:4:61: error: use of undeclared identifier 'l'
void f3(int *l) __attribute__((__exclusive_lock_function__(*l)));
^
1 error generated.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs