[PATCH 1/6] disas: add G_GNUC_PRINTF to gstring_printf

Daniel P. Berrangé posted 6 patches 3 years, 1 month ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony Perard <anthony.perard@citrix.com>, Paul Durrant <paul@xen.org>, John Snow <jsnow@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>, Gerd Hoffmann <kraxel@redhat.com>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>
[PATCH 1/6] disas: add G_GNUC_PRINTF to gstring_printf
Posted by Daniel P. Berrangé 3 years, 1 month ago
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 disas.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/disas.c b/disas.c
index 94d3b45042..31df8f5b89 100644
--- a/disas.c
+++ b/disas.c
@@ -239,6 +239,7 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code,
     }
 }
 
+G_GNUC_PRINTF(2, 3)
 static int gstring_printf(FILE *stream, const char *fmt, ...)
 {
     /* We abuse the FILE parameter to pass a GString. */
-- 
2.38.1


Re: [PATCH 1/6] disas: add G_GNUC_PRINTF to gstring_printf
Posted by Stefan Weil 3 years, 1 month ago
Am 19.12.22 um 14:02 schrieb Daniel P. Berrangé:
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   disas.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/disas.c b/disas.c
> index 94d3b45042..31df8f5b89 100644
> --- a/disas.c
> +++ b/disas.c
> @@ -239,6 +239,7 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code,
>       }
>   }
>   
> +G_GNUC_PRINTF(2, 3)
>   static int gstring_printf(FILE *stream, const char *fmt, ...)
>   {
>       /* We abuse the FILE parameter to pass a GString. */

The current code uses a different pattern:

static RETURN_TYPE G_GNUC_PRINTF(2, 3) function(argument list)

So I would have expected

static int G_GNUC_PRINTF(2, 3)
gstring_printf(FILE *stream, const char *fmt, ...)

Does that matter? Do we care for different patterns?

Stefan