https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118769
Bug ID: 118769 Summary: Provide better location information for diagnostics with -Wattributes Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgdiagnostics Assignee: dmalcolm at gcc dot gnu.org Reporter: gjl at gcc dot gnu.org Target Milestone: --- Compiling the following code with v15 __attribute__((xxx)) void my4 () {} I am getting the following diagnostic: file.c:2:1: warning: 'xxx' attribute directive ignored [-Wattributes] 2 | void my4 () {} | ^~~~ There in nothing wrong with "void". IMHO the diagnostic should point to the unrecognized attribute. Or with: __attribute__((used(10))) void my5 () {} file.c:2:1: error: wrong number of arguments specified for 'used' attribute 2 | void my5 () {} | ^~~~ file.c:2:1: note: expected 0, found 1