From e30c787a0cef6cc7dccb4da730b6163e1d1c485b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Fri, 18 Oct 2019 23:12:19 +0200 Subject: [PATCH] docs: hacking: mention compiler annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mention all the __attribute__ annotations we use to make the compiler and/or the static analysis tools understand the code better. Signed-off-by: Ján Tomko Reviewed-by: Daniel P. Berrangé Reviewed-by: Andrea Bolognani --- docs/hacking.html.in | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index ae4d14e7b7..f3ad43eee7 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -985,6 +985,25 @@ BAD: it points to, or it is aliased to another pointer that is.

+

Attribute annotations

+

+ Use the following annotations to help the compiler and/or static + analysis tools understand the code better: +

+ + + + + + + + + + + + +
MacroMeaning
ATTRIBUTE_NONNULLpassing NULL for this parameter is not allowed
ATTRIBUTE_PACKEDforce a structure to be packed
G_GNUC_FALLTHROUGHallow code reuse by multiple switch cases
G_GNUC_NO_INLINEthe function is mocked in the test suite
G_GNUC_NORETURNthe function never returns
G_GNUC_NULL_TERMINATEDlast parameter must be NULL
G_GNUC_PRINTFvalidate that the formatting string matches parameters
G_GNUC_UNUSEDparameter is unused in this implementation of the function
G_GNUC_WARN_UNUSED_RESULTthe return value must be checked
+

Adoption of GLib APIs

-- GitLab