docs: Clarify that G_GNUC_UNUSED can’t be used on definitions

Only on declarations.

This has now bitten me multiple times.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-07-20 19:11:13 +02:00
parent 107b47226c
commit 0b8f69b28a
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -276,7 +276,8 @@ by application programmers.
It avoids possible compiler warnings. It avoids possible compiler warnings.
For functions, place the attribute after the declaration, just before the For functions, place the attribute after the declaration, just before the
semicolon. For arguments, place the attribute at the beginning of the semicolon. It cannot go in the definition of a function, only the
declaration. For arguments, place the attribute at the beginning of the
argument declaration. argument declaration.
void my_unused_function (G_GNUC_UNUSED gint unused_argument, void my_unused_function (G_GNUC_UNUSED gint unused_argument,