提交 6cc9b74e 编写于 作者: J Ján Tomko

docs: hacking: remove reference to ATTRIBUTE_FORMAT

Prefer G_GNUC_PRINTF.

Also, pick another example than virAsprintf since it may get
removed in the future.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
上级 2d0b8560
......@@ -1379,12 +1379,12 @@ BAD:
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. For example, here's
the one for virAsprintf, in util.h:
the one for virCommandAddEnvFormat in vircommand.h:
</p>
<pre>
int virAsprintf(char **strp, const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 2, 3);
void virCommandAddEnvFormat(virCommandPtr cmd, const char *format, ...)
G_GNUC_PRINTF(2, 3);
</pre>
<p>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册