https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68524

            Bug ID: 68524
           Summary: Please support attributes between function definition
                    and opening brace
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: josh at joshtriplett dot org
  Target Milestone: ---

GCC supports placing attributes after the closing parenthesis of a function
declaration and before the semicolon.  However, GCC produces an error on
attributes between the closing parenthesis of a function definition and the
opening brace; for instance:

void f(void) __attribute__((const))
{
}

test.c:1:1: error: attributes should be specified before the declarator in a
function definition
 void f(void) __attribute__((const))
 ^

Sparse's C parser supports this.  Could GCC support this syntax as well?

Reply via email to