]> git.proxmox.com Git - qemu.git/blobdiff - HACKING
usb-hid: fixup changed tracking.
[qemu.git] / HACKING
diff --git a/HACKING b/HACKING
index 3ad87aa3626418836b8b3c1d845c17a8490fa569..3af53fdcb8c3eb1411abf2d46e452338a68a9a28 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -110,3 +110,13 @@ so instead of e.g. isalnum you should use qemu_isalnum.
 
 Because of the memory management rules, you must use qemu_strdup/qemu_strndup
 instead of plain strdup/strndup.
+
+5. Printf-style functions
+
+Whenever you add a new printf-style function, i.e., one with a format
+string argument and following "..." in its prototype, be sure to use
+gcc's printf attribute directive in the prototype.
+
+This makes it so gcc's -Wformat and -Wformat-security options can do
+their jobs and cross-check format strings with the number and types
+of arguments.