Skip to content

Commit

Permalink
Mention G_GNUC_UNUSED macro. (#1582)
Browse files Browse the repository at this point in the history
Mention G_GNUC_UNUSED as an alternative to `-Wno-unused-parameter`.
  • Loading branch information
LarsGit223 authored and elextr committed Aug 21, 2017
1 parent 3ffc577 commit f1b84c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion HACKING
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ to set warning options (as well as anything else e.g. -g -O2).

* Enable warnings - for gcc use '-Wall -Wextra' (and optionally
-Wno-unused-parameter to avoid unused parameter warnings in Glade
callbacks).
callbacks). Alternatively you can use the Glib macro G_GNUC_UNUSED
to suppress warnings on single parameters, e.g.
``void examplefunction(G_GNUC_UNUSED gchar *foo)``. Also see
https://developer.gnome.org/glib/stable/glib-Miscellaneous-Macros.html.
* You should try to write ISO C99 code for portability, so always
use C ``/* */`` comments and function_name(void) instead of
function_name(). This is for compatibility with various Unix-like
Expand Down

0 comments on commit f1b84c9

Please sign in to comment.