mirror of https://gitee.com/openkylin/libvirt.git
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: Ján Tomko <jtomko@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
2d0b8560ce
commit
6cc9b74e0e
|
@ -1379,12 +1379,12 @@ BAD:
|
||||||
Whenever you add a new printf-style function, i.e., one with a format
|
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
|
string argument and following "..." in its prototype, be sure to use
|
||||||
gcc's printf attribute directive in the prototype. For example, here's
|
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>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
int virAsprintf(char **strp, const char *fmt, ...)
|
void virCommandAddEnvFormat(virCommandPtr cmd, const char *format, ...)
|
||||||
ATTRIBUTE_FORMAT(printf, 2, 3);
|
G_GNUC_PRINTF(2, 3);
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Reference in New Issue