https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124533
Bug ID: 124533
Summary: musttail: __attribute__ syntax behavior differs in odd
ways from [[gnu::musttail]]
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: wingo at pobox dot com
Target Milestone: ---
Consider:
```
$ gcc --version | head -1
gcc (GCC) 15.2.0
$ cat /tmp/test1.c
extern int g(void);
static int h(void) {
label_0:
__attribute__((musttail)) return g();
}
$ gcc -o /tmp/test1.o -c /tmp/test1.c
/tmp/test1.c: In function ‘h’:
/tmp/test1.c:5:3: warning: ‘musttail’ attribute ignored [-Wattributes]
5 | __attribute__((musttail)) return g();
| ^~~~~~~~~~~~~
```
There is no error with `[[gnu::musttail]]`. Also, there is no error if I
remove the unused label.
I think I would expect that `__attribute__((musttail))` would produce an error
instead of a warning if it fails to apply.