https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125991
Bug ID: 125991
Summary: btf_type_tag not supported for function returning a
pointer
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: vineetg at gcc dot gnu.org
CC: dfaust at gcc dot gnu.org, jemarch at gcc dot gnu.org
Target Milestone: ---
```
struct msr {
int a;
};
struct msr __attribute__((btf_type_tag("percpu"))) *msrs_alloc(void);
```
/* warning: ‘btf_type_tag’ attribute does not apply to functions [-Wattributes]
*/
Following are the arguments to support this
1. This is in same vein as type tags in regular pointers
int __typetag *ptr
2. It is incorrectly trying to associate it with function, it needs to do this
for function return pointer.
3. clang supports this and attaches the type tag to function return pointer
4. This is a very common occurance in kerenl code given the percpu types and
spews warning when enabling btf tags for gcc, requiring -Wno-attributes which
ends up loosing a good diagnostic for legit cases.