diff options
author | Philip Withnall <pwithnall@gnome.org> | 2024-07-20 19:11:13 +0200 |
---|---|---|
committer | Philip Withnall <pwithnall@gnome.org> | 2024-07-20 19:11:13 +0200 |
commit | 0b8f69b28ab13f5dc0ef5f44ce51fd7c7451a642 (patch) | |
tree | eb2c3f28c7677e323cb47d19176551e57b472604 | |
parent | 107b47226cfdd2e546e74b693700f8208fb878ed (diff) |
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>
-rw-r--r-- | docs/reference/glib/macros.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/reference/glib/macros.md b/docs/reference/glib/macros.md index 2fea9db75..469ecdd1a 100644 --- a/docs/reference/glib/macros.md +++ b/docs/reference/glib/macros.md @@ -276,7 +276,8 @@ by application programmers. It avoids possible compiler warnings. 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. void my_unused_function (G_GNUC_UNUSED gint unused_argument, |