* [Qemu-devel] [PATCH for 1.7] qobject: Fix compiler warning (missing gnu_printf format attribute)
@ 2013-11-17 18:00 Stefan Weil
2013-11-20 9:53 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2013-11-17 18:00 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-trivial, Stefan Weil, qemu-devel
gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra):
CC qobject/qerror.o
qobject/qerror.c: In function ‘qerror_from_info’:
qobject/qerror.c:53:5: error:
function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
qerr->err_msg = g_strdup_vprintf(fmt, *va);
^
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
Note: checkpatch.pl wrongly reports an error.
qobject/qerror.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qobject/qerror.c b/qobject/qerror.c
index 3aee1cf..fc8331a 100644
--- a/qobject/qerror.c
+++ b/qobject/qerror.c
@@ -42,8 +42,8 @@ static QError *qerror_new(void)
*
* Return strong reference.
*/
-static QError *qerror_from_info(ErrorClass err_class, const char *fmt,
- va_list *va)
+static QError * GCC_FMT_ATTR(2, 0)
+qerror_from_info(ErrorClass err_class, const char *fmt, va_list *va)
{
QError *qerr;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [Qemu-devel] [Qemu-trivial] [PATCH for 1.7] qobject: Fix compiler warning (missing gnu_printf format attribute)
2013-11-17 18:00 [Qemu-devel] [PATCH for 1.7] qobject: Fix compiler warning (missing gnu_printf format attribute) Stefan Weil
@ 2013-11-20 9:53 ` Michael Tokarev
0 siblings, 0 replies; 2+ messages in thread
From: Michael Tokarev @ 2013-11-20 9:53 UTC (permalink / raw)
To: Stefan Weil; +Cc: qemu-trivial, qemu-devel, Anthony Liguori
17.11.2013 22:00, Stefan Weil wrote:
> gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra):
>
> CC qobject/qerror.o
> qobject/qerror.c: In function ‘qerror_from_info’:
> qobject/qerror.c:53:5: error:
> function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
> qerr->err_msg = g_strdup_vprintf(fmt, *va);
> ^
Thanks, applied to the trivial-patches queue. Hopefully we found and verified
all invlcations of qerror_from_info() and there really are no "wrong" invocations
which will lead to new warnings after this printf attribute addition... ;)
(This function is static so only this file needed to be checked).
/mjt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-20 9:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-17 18:00 [Qemu-devel] [PATCH for 1.7] qobject: Fix compiler warning (missing gnu_printf format attribute) Stefan Weil
2013-11-20 9:53 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).