Does the GCC compiler care where we put the attribute statements inside of declarations? For example is the following equivalent:
void foobar (void) __attribute__ ((section ("bar")));
__attribute__ ((section ("bar"))) void foobar (void);
I have seen here that there is no convention on how they are used. Sometimes before declaration, sometimes after.
It depends on what type of declarator shall be subject to the attribute.
An excerpt from https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax
Label Attributes
In GNU C, an attribute specifier list may appear after the colon following a label, other than a case or default label. GNU C++ only permits attributes on labels if the attribute specifier is immediately followed by a semicolon (i.e., the label applies to an empty statement). If the semicolon is missing, C++ label attributes are ambiguous, as it is permissible for a declaration, which could begin with an attribute list, to be labelled in C++. Declarations cannot be labelled in C90 or C99, so the ambiguity does not arise there.
Enumerator Attributes
In GNU C, an attribute specifier list may appear as part of an enumerator. The attribute goes after the enumeration constant, before =, if present. The optional attribute in the enumerator appertains to the enumeration constant. It is not possible to place the attribute after the constant expression, if present.
Statement Attributes
In GNU C, an attribute specifier list may appear as part of a null statement. The attribute goes before the semicolon.
...