diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index b04716a6cc212d13858ae80c36eb6513ce486286..4a61378cd757ae84c27ef45f560266677e9fb640 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -72,7 +72,7 @@ struct alsa_params_obt { snd_pcm_uframes_t samples; }; -static void GCC_FMT_ATTR (2, 3) alsa_logerr (int err, const char *fmt, ...) +static void G_GNUC_PRINTF (2, 3) alsa_logerr (int err, const char *fmt, ...) { va_list ap; @@ -83,7 +83,7 @@ static void GCC_FMT_ATTR (2, 3) alsa_logerr (int err, const char *fmt, ...) AUD_log (AUDIO_CAP, "Reason: %s\n", snd_strerror (err)); } -static void GCC_FMT_ATTR (3, 4) alsa_logerr2 ( +static void G_GNUC_PRINTF (3, 4) alsa_logerr2 ( int err, const char *typ, const char *fmt, diff --git a/audio/audio.h b/audio/audio.h index c8bde536b5cd1dca9ffb23bb86ee77e1b3ec2464..cbb10f4816e5eaeef28f303b02c34b9c6893a503 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -91,8 +91,8 @@ typedef struct QEMUAudioTimeStamp { uint64_t old_ts; } QEMUAudioTimeStamp; -void AUD_vlog (const char *cap, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); -void AUD_log (const char *cap, const char *fmt, ...) GCC_FMT_ATTR(2, 3); +void AUD_vlog (const char *cap, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0); +void AUD_log (const char *cap, const char *fmt, ...) G_GNUC_PRINTF(2, 3); void AUD_register_card (const char *name, QEMUSoundCard *card); void AUD_remove_card (QEMUSoundCard *card); diff --git a/audio/coreaudio.m b/audio/coreaudio.m index 3186b68474d084f2f3318ec13952acdd52dd5cc5..4695291621a3c9f4fff66f983d2900a13f9aada9 100644 --- a/audio/coreaudio.m +++ b/audio/coreaudio.m @@ -211,7 +211,7 @@ static void coreaudio_logstatus (OSStatus status) AUD_log (AUDIO_CAP, "Reason: %s\n", str); } -static void GCC_FMT_ATTR (2, 3) coreaudio_logerr ( +static void G_GNUC_PRINTF (2, 3) coreaudio_logerr ( OSStatus status, const char *fmt, ... @@ -226,7 +226,7 @@ static void GCC_FMT_ATTR (2, 3) coreaudio_logerr ( coreaudio_logstatus (status); } -static void GCC_FMT_ATTR (3, 4) coreaudio_logerr2 ( +static void G_GNUC_PRINTF (3, 4) coreaudio_logerr2 ( OSStatus status, const char *typ, const char *fmt, diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 2b41db217e7a6cbadb629000a16e1adb319bded8..3fb67ec3eed4bbf8309919d8baed9a1c6585c7e6 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -222,7 +222,7 @@ static void dsound_log_hresult (HRESULT hr) AUD_log (AUDIO_CAP, "Reason: %s\n", str); } -static void GCC_FMT_ATTR (2, 3) dsound_logerr ( +static void G_GNUC_PRINTF (2, 3) dsound_logerr ( HRESULT hr, const char *fmt, ... @@ -237,7 +237,7 @@ static void GCC_FMT_ATTR (2, 3) dsound_logerr ( dsound_log_hresult (hr); } -static void GCC_FMT_ATTR (3, 4) dsound_logerr2 ( +static void G_GNUC_PRINTF (3, 4) dsound_logerr2 ( HRESULT hr, const char *typ, const char *fmt, diff --git a/audio/ossaudio.c b/audio/ossaudio.c index da9c232222e36043e585a8c6199c4c30852b7ea7..8e075edb70d6e8c55b57d2bc417270d9752a12a8 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -63,7 +63,7 @@ struct oss_params { int fragsize; }; -static void GCC_FMT_ATTR (2, 3) oss_logerr (int err, const char *fmt, ...) +static void G_GNUC_PRINTF (2, 3) oss_logerr (int err, const char *fmt, ...) { va_list ap; @@ -74,7 +74,7 @@ static void GCC_FMT_ATTR (2, 3) oss_logerr (int err, const char *fmt, ...) AUD_log (AUDIO_CAP, "Reason: %s\n", strerror (err)); } -static void GCC_FMT_ATTR (3, 4) oss_logerr2 ( +static void G_GNUC_PRINTF (3, 4) oss_logerr2 ( int err, const char *typ, const char *fmt, diff --git a/audio/paaudio.c b/audio/paaudio.c index ed4f4376c4ba15daddb3c95fe3f54516384dba3d..e91116f2396c739a0160751bf4398e2032e6ebb5 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -43,7 +43,7 @@ typedef struct { static void qpa_conn_fini(PAConnection *c); -static void GCC_FMT_ATTR (2, 3) qpa_logerr (int err, const char *fmt, ...) +static void G_GNUC_PRINTF (2, 3) qpa_logerr (int err, const char *fmt, ...) { va_list ap; diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 797b47bbddb14c991881d30b9de873a9500c90f5..68a237b76b45de9b37c7ea17aa03290225af5331 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -55,7 +55,7 @@ typedef struct SDLVoiceIn { SDL_AudioDeviceID devid; } SDLVoiceIn; -static void GCC_FMT_ATTR (1, 2) sdl_logerr (const char *fmt, ...) +static void G_GNUC_PRINTF (1, 2) sdl_logerr (const char *fmt, ...) { va_list ap; diff --git a/block/blkverify.c b/block/blkverify.c index 53ba1c91957282c311a87bc460326dc8db6b1857..e4a37af3b2ef5bdb3e145f88a1c43102a92ebb40 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -44,7 +44,7 @@ typedef struct BlkverifyRequest { QEMUIOVector *raw_qiov; /* cloned I/O vector for raw file */ } BlkverifyRequest; -static void GCC_FMT_ATTR(2, 3) blkverify_err(BlkverifyRequest *r, +static void G_GNUC_PRINTF(2, 3) blkverify_err(BlkverifyRequest *r, const char *fmt, ...) { va_list ap; diff --git a/block/qcow2.h b/block/qcow2.h index fd48a89d452cd34919e8b2577fdb0e0f6d24755b..ba436a8d0d68275cba6d9ae8f3de5186f15c7c11 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -838,7 +838,7 @@ int qcow2_update_header(BlockDriverState *bs); void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t offset, int64_t size, const char *message_format, ...) - GCC_FMT_ATTR(5, 6); + G_GNUC_PRINTF(5, 6); int qcow2_validate_table(BlockDriverState *bs, uint64_t offset, uint64_t entries, size_t entry_len, diff --git a/block/ssh.c b/block/ssh.c index a64db146dbdc2c959144ccd779794ed2f2562b2a..a2dc64653699e51701a56d0522f30c07c81281e7 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -108,7 +108,7 @@ static void ssh_state_free(BDRVSSHState *s) } } -static void GCC_FMT_ATTR(3, 4) +static void G_GNUC_PRINTF(3, 4) session_error_setg(Error **errp, BDRVSSHState *s, const char *fs, ...) { va_list args; @@ -133,7 +133,7 @@ session_error_setg(Error **errp, BDRVSSHState *s, const char *fs, ...) g_free(msg); } -static void GCC_FMT_ATTR(3, 4) +static void G_GNUC_PRINTF(3, 4) sftp_error_setg(Error **errp, BDRVSSHState *s, const char *fs, ...) { va_list args; diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index af272c2a802a5a9575ea6fba9248428f36cbd896..21c06f2e70032a4ef723a8a4a40201e3d2293d46 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -175,7 +175,7 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6); -void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void gemu_log(const char *fmt, ...) G_GNUC_PRINTF(1, 2); extern __thread CPUState *thread_cpu; void cpu_loop(CPUArchState *env); char *target_strerror(int err); diff --git a/fsdev/9p-marshal.c b/fsdev/9p-marshal.c index 51881fe2201075f01acc55730cdb0cf4edfc46f6..f9b0336cd59d7e4247c511d0bcf68e95802c2966 100644 --- a/fsdev/9p-marshal.c +++ b/fsdev/9p-marshal.c @@ -27,7 +27,7 @@ void v9fs_string_free(V9fsString *str) str->size = 0; } -void GCC_FMT_ATTR(2, 3) +void G_GNUC_PRINTF(2, 3) v9fs_string_sprintf(V9fsString *str, const char *fmt, ...) { va_list ap; diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index 15c0e79b067b89a6253a680dbf0126c89d74ce47..d06a0f7b83269897298e2e9493634f060c3d5166 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -57,7 +57,7 @@ static bool is_daemon; static bool get_version; /* IOC getversion IOCTL supported */ static char *prog_name; -static void GCC_FMT_ATTR(2, 3) do_log(int loglevel, const char *format, ...) +static void G_GNUC_PRINTF(2, 3) do_log(int loglevel, const char *format, ...) { va_list ap; diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 8e9d4aea737ff814ec3114d2cc3b5b7dbb0f8ef7..dcaa602d4cd1c48999af7dbef801b0b1b5215531 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -203,7 +203,7 @@ void v9fs_path_free(V9fsPath *path) } -void GCC_FMT_ATTR(2, 3) +void G_GNUC_PRINTF(2, 3) v9fs_path_sprintf(V9fsPath *path, const char *fmt, ...) { va_list ap; diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 1773cf55f1eea0eec750bbf82f4f5c358caebcca..4086879ebff94e556527b7c9b293ca36ba85f7f6 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -207,7 +207,7 @@ build_append_nameseg(GArray *array, const char *seg) g_array_append_vals(array, "____", ACPI_NAMESEG_LEN - len); } -static void GCC_FMT_ATTR(2, 0) +static void G_GNUC_PRINTF(2, 0) build_append_namestringv(GArray *array, const char *format, va_list ap) { char *s; @@ -270,7 +270,7 @@ build_append_namestringv(GArray *array, const char *format, va_list ap) g_strfreev(segs); } -GCC_FMT_ATTR(2, 3) +G_GNUC_PRINTF(2, 3) static void build_append_namestring(GArray *array, const char *format, ...) { va_list ap; diff --git a/hw/display/qxl.h b/hw/display/qxl.h index 30d21f4d0bdcee78dd0bc97239e4426459fdce19..e74de9579df3db6e3b6924b1a8c233b5ad2ecbaf 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -149,7 +149,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(PCIQXLDevice, PCI_QXL) /* qxl.c */ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id); void qxl_set_guest_bug(PCIQXLDevice *qxl, const char *msg, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t surface_id, struct QXLRect *area, struct QXLRect *dirty_rects, diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index c1b8066a13b03a65fb6c617f8becf3d46362cee3..c9f14e70a07723bf32594885080ebaf5ec262083 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -72,7 +72,7 @@ static struct _loaderparams { const char *initrd_filename; } loaderparams; -static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t *prom_buf, int index, +static void G_GNUC_PRINTF(3, 4) prom_set(uint32_t *prom_buf, int index, const char *string, ...) { va_list ap; diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 55037eb90f0e596e019fb61c960e61321ccb187d..6288511723e1c81c450c6d86bbcd1650e3c532fc 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -995,7 +995,7 @@ static void write_bootloader(uint8_t *base, uint64_t run_addr, } -static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t *prom_buf, int index, +static void G_GNUC_PRINTF(3, 4) prom_set(uint32_t *prom_buf, int index, const char *string, ...) { va_list ap; diff --git a/hw/net/rocker/rocker.h b/hw/net/rocker/rocker.h index 412fa44d017143b4f21a20bb4612400aefff4494..f85354d9d1368f34d918674335e8a52da92824c1 100644 --- a/hw/net/rocker/rocker.h +++ b/hw/net/rocker/rocker.h @@ -30,7 +30,7 @@ fprintf(stderr, "%s ROCKER: " fmt, nowstr, ## __VA_ARGS__);\ } while (0) #else -static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...) +static inline G_GNUC_PRINTF(1, 2) int DPRINTF(const char *fmt, ...) { return 0; } diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 90b4fc63ce64e07ab495bb477f5dc83371fc4ce3..6b65823b4bf8cab4e5d208f5abcbbbd4343041d3 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -86,7 +86,7 @@ # define DPRINTF(fmt, ...) \ do { fprintf(stderr, "RTL8139: " fmt, ## __VA_ARGS__); } while (0) #else -static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...) +static inline G_GNUC_PRINTF(1, 2) int DPRINTF(const char *fmt, ...) { return 0; } diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 32b18593915b0bc959c25c6d6afc17bd8f260f20..9d637e043e6b50025b61f612f63190449177f786 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3579,7 +3579,7 @@ void virtio_device_set_child_bus_name(VirtIODevice *vdev, char *bus_name) vdev->bus_name = g_strdup(bus_name); } -void GCC_FMT_ATTR(2, 3) virtio_error(VirtIODevice *vdev, const char *fmt, ...) +void G_GNUC_PRINTF(2, 3) virtio_error(VirtIODevice *vdev, const char *fmt, ...) { va_list ap; diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index c74c4678f20dbe84ebda582fc89a56b4982ddc06..6b8e13cdeed518091f2bf983ce075ccd7791913d 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -9,7 +9,7 @@ bool xen_igd_gfx_pt_enabled(void); void xen_igd_gfx_pt_set(bool value, Error **errp); -void xen_pt_log(const PCIDevice *d, const char *f, ...) GCC_FMT_ATTR(2, 3); +void xen_pt_log(const PCIDevice *d, const char *f, ...) G_GNUC_PRINTF(2, 3); #define XEN_PT_ERR(d, _f, _a...) xen_pt_log(d, "%s: Error: "_f, __func__, ##_a) diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h index 867ef1b3b28ae15bcc2e0b5300bb4e3bed408018..8c420fa36e3cb772d89e9d09e5c3e5c7f0afb2ca 100644 --- a/include/chardev/char-fe.h +++ b/include/chardev/char-fe.h @@ -172,7 +172,7 @@ void qemu_chr_fe_set_open(CharBackend *be, int fe_open); * Chardev. */ void qemu_chr_fe_printf(CharBackend *be, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); typedef gboolean (*FEWatchFunc)(void *do_not_use, GIOCondition condition, void *data); diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h index 102a1e7f504e9c51d9e1b59d6016d84bbf758cfe..fadf6a65ef150a8e0bb8254561a266cf206fa909 100644 --- a/include/disas/dis-asm.h +++ b/include/disas/dis-asm.h @@ -269,7 +269,7 @@ typedef struct symbol_cache_entry } asymbol; typedef int (*fprintf_function)(FILE *f, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); enum dis_insn_type { dis_noninsn, /* Not a valid instruction */ diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 8346003a224b027e01996024abaae0582f116ce9..d1fb08514bfa04dda0fb32226e1e77737c13b887 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -289,7 +289,7 @@ void free_aml_allocator(void); void aml_append(Aml *parent_ctx, Aml *child); /* non block AML object primitives */ -Aml *aml_name(const char *name_format, ...) GCC_FMT_ATTR(1, 2); +Aml *aml_name(const char *name_format, ...) G_GNUC_PRINTF(1, 2); Aml *aml_name_decl(const char *name, Aml *val); Aml *aml_debug(void); Aml *aml_return(Aml *val); @@ -344,13 +344,13 @@ Aml *aml_irq_no_flags(uint8_t irq); Aml *aml_named_field(const char *name, unsigned length); Aml *aml_reserved_field(unsigned length); Aml *aml_local(int num); -Aml *aml_string(const char *name_format, ...) GCC_FMT_ATTR(1, 2); +Aml *aml_string(const char *name_format, ...) G_GNUC_PRINTF(1, 2); Aml *aml_lnot(Aml *arg); Aml *aml_equal(Aml *arg1, Aml *arg2); Aml *aml_lgreater(Aml *arg1, Aml *arg2); Aml *aml_lgreater_equal(Aml *arg1, Aml *arg2); Aml *aml_processor(uint8_t proc_id, uint32_t pblk_addr, uint8_t pblk_len, - const char *name_format, ...) GCC_FMT_ATTR(4, 5); + const char *name_format, ...) G_GNUC_PRINTF(4, 5); Aml *aml_eisaid(const char *str); Aml *aml_word_bus_number(AmlMinFixed min_fixed, AmlMaxFixed max_fixed, AmlDecode dec, uint16_t addr_gran, @@ -384,8 +384,8 @@ Aml *aml_sleep(uint64_t msec); Aml *aml_i2c_serial_bus_device(uint16_t address, const char *resource_source); /* Block AML object primitives */ -Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2); -Aml *aml_device(const char *name_format, ...) GCC_FMT_ATTR(1, 2); +Aml *aml_scope(const char *name_format, ...) G_GNUC_PRINTF(1, 2); +Aml *aml_device(const char *name_format, ...) G_GNUC_PRINTF(1, 2); Aml *aml_method(const char *name, int arg_count, AmlSerializeFlag sflag); Aml *aml_if(Aml *predicate); Aml *aml_else(void); @@ -460,7 +460,7 @@ build_xsdt(GArray *table_data, BIOSLinker *linker, GArray *table_offsets, int build_append_named_dword(GArray *array, const char *name_format, ...) -GCC_FMT_ATTR(2, 3); +G_GNUC_PRINTF(2, 3); void build_append_gas(GArray *table, AmlAddressSpace as, uint8_t bit_width, uint8_t bit_offset, diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 0efc6153ed03bbe2594841751944f8d153867f0c..136973655c1aebe2e659a0f32fe1ab16f2e50d3c 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1016,7 +1016,7 @@ int cpu_watchpoint_address_matches(CPUState *cpu, vaddr addr, vaddr len); AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx); void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); /* $(top_srcdir)/cpu.c */ void cpu_class_init_props(DeviceClass *dc); diff --git a/include/hw/hw.h b/include/hw/hw.h index fc5301f29372e699c7bcd0767ca008af47679c74..34377f5309d3d0ceaf866e650f3de5490d1b254e 100644 --- a/include/hw/hw.h +++ b/include/hw/hw.h @@ -5,6 +5,6 @@ #error Cannot include hw/hw.h from user emulation #endif -void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void QEMU_NORETURN hw_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2); #endif diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index f095637058dc8cfea064365830b790ec346b65aa..b31c4507f5ddeb3ce96865138911bd7844836400 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -169,7 +169,7 @@ void virtio_init(VirtIODevice *vdev, const char *name, uint16_t device_id, size_t config_size); void virtio_cleanup(VirtIODevice *vdev); -void virtio_error(VirtIODevice *vdev, const char *fmt, ...) GCC_FMT_ATTR(2, 3); +void virtio_error(VirtIODevice *vdev, const char *fmt, ...) G_GNUC_PRINTF(2, 3); /* Set the child bus name. */ void virtio_device_set_child_bus_name(VirtIODevice *vdev, char *bus_name); diff --git a/include/hw/xen/xen-bus-helper.h b/include/hw/xen/xen-bus-helper.h index 4c0f747445c2dc937e8ee373393cdc7cb0b69524..629a904d1a860891839e91dd4467f45f6dc6accb 100644 --- a/include/hw/xen/xen-bus-helper.h +++ b/include/hw/xen/xen-bus-helper.h @@ -22,11 +22,11 @@ void xs_node_destroy(struct xs_handle *xsh, xs_transaction_t tid, void xs_node_vprintf(struct xs_handle *xsh, xs_transaction_t tid, const char *node, const char *key, Error **errp, const char *fmt, va_list ap) - GCC_FMT_ATTR(6, 0); + G_GNUC_PRINTF(6, 0); void xs_node_printf(struct xs_handle *xsh, xs_transaction_t tid, const char *node, const char *key, Error **errp, const char *fmt, ...) - GCC_FMT_ATTR(6, 7); + G_GNUC_PRINTF(6, 7); /* Read from node/key unless node is empty, in which case read from key */ int xs_node_vscanf(struct xs_handle *xsh, xs_transaction_t tid, diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h index 6bdbf3ff82209725c41fc390c4b324bcc4c6f82a..713e763348f4c1ecccc8116c3293df3094be120d 100644 --- a/include/hw/xen/xen-bus.h +++ b/include/hw/xen/xen-bus.h @@ -88,10 +88,10 @@ enum xenbus_state xen_device_backend_get_state(XenDevice *xendev); void xen_device_backend_printf(XenDevice *xendev, const char *key, const char *fmt, ...) - GCC_FMT_ATTR(3, 4); + G_GNUC_PRINTF(3, 4); void xen_device_frontend_printf(XenDevice *xendev, const char *key, const char *fmt, ...) - GCC_FMT_ATTR(3, 4); + G_GNUC_PRINTF(3, 4); int xen_device_frontend_scanf(XenDevice *xendev, const char *key, const char *fmt, ...); diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h index a8118b41acfb7b2c45e06644a6e6d705a4346cd8..179741ff791c20210de28225913dc653acff5604 100644 --- a/include/hw/xen/xen_common.h +++ b/include/hw/xen/xen_common.h @@ -358,7 +358,7 @@ static inline int xen_restrict(domid_t domid) void destroy_hvm_domain(bool reboot); /* shutdown/destroy current domain because of an error */ -void xen_shutdown_fatal_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void xen_shutdown_fatal_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2); #ifdef HVM_PARAM_VMPORT_REGS_PFN static inline int xen_get_vmport_regs_pfn(xc_interface *xc, domid_t dom, diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index 83e5174d902951cff64c87dfcc82f62af0b7d9b5..7cd4bc2b828426b1e67694d0af970bfa15ec9c14 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -76,6 +76,6 @@ void xen_pv_unbind_evtchn(struct XenLegacyDevice *xendev); int xen_pv_send_notify(struct XenLegacyDevice *xendev); void xen_pv_printf(struct XenLegacyDevice *xendev, int msg_level, - const char *fmt, ...) GCC_FMT_ATTR(3, 4); + const char *fmt, ...) G_GNUC_PRINTF(3, 4); #endif /* QEMU_HW_XEN_PVDEV_H */ diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 12d395d62d6b3993e035331d4d7570edbbc7b83a..cc4cc6c6adcf61e596f68fe5135d4d2c412d3871 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -32,8 +32,8 @@ int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp); int monitor_fd_param(Monitor *mon, const char *fdname, Error **errp); int monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); -int monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 0); +int monitor_printf(Monitor *mon, const char *fmt, ...) G_GNUC_PRINTF(2, 3); void monitor_flush(Monitor *mon); int monitor_set_cpu(Monitor *mon, int cpu_index); int monitor_get_cpu_index(Monitor *mon); diff --git a/include/qapi/error.h b/include/qapi/error.h index 4a9260b0cc00d411128320e16351dfd0a66eb53e..d798faeec3e936b9bc774428c750f1dfbcc6dc8d 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -320,7 +320,7 @@ ErrorClass error_get_class(const Error *err); void error_setg_internal(Error **errp, const char *src, int line, const char *func, const char *fmt, ...) - GCC_FMT_ATTR(5, 6); + G_GNUC_PRINTF(5, 6); /* * Just like error_setg(), with @os_error info added to the message. @@ -336,7 +336,7 @@ void error_setg_internal(Error **errp, void error_setg_errno_internal(Error **errp, const char *fname, int line, const char *func, int os_error, const char *fmt, ...) - GCC_FMT_ATTR(6, 7); + G_GNUC_PRINTF(6, 7); #ifdef _WIN32 /* @@ -350,7 +350,7 @@ void error_setg_errno_internal(Error **errp, void error_setg_win32_internal(Error **errp, const char *src, int line, const char *func, int win32_err, const char *fmt, ...) - GCC_FMT_ATTR(6, 7); + G_GNUC_PRINTF(6, 7); #endif /* @@ -383,21 +383,21 @@ void error_propagate(Error **dst_errp, Error *local_err); */ void error_propagate_prepend(Error **dst_errp, Error *local_err, const char *fmt, ...) - GCC_FMT_ATTR(3, 4); + G_GNUC_PRINTF(3, 4); /* * Prepend some text to @errp's human-readable error message. * The text is made by formatting @fmt, @ap like vprintf(). */ void error_vprepend(Error *const *errp, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); + G_GNUC_PRINTF(2, 0); /* * Prepend some text to @errp's human-readable error message. * The text is made by formatting @fmt, ... like printf(). */ void error_prepend(Error *const *errp, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); /* * Append a printf-style human-readable explanation to an existing error. @@ -414,7 +414,7 @@ void error_prepend(Error *const *errp, const char *fmt, ...) * newline. */ void error_append_hint(Error *const *errp, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); /* * Convenience function to report open() failure. @@ -458,13 +458,13 @@ void error_report_err(Error *err); * Convenience function to error_prepend(), warn_report() and free @err. */ void warn_reportf_err(Error *err, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); /* * Convenience function to error_prepend(), error_report() and free @err. */ void error_reportf_err(Error *err, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); /* * Just like error_setg(), except you get to specify the error class. @@ -477,7 +477,7 @@ void error_reportf_err(Error *err, const char *fmt, ...) void error_set_internal(Error **errp, const char *src, int line, const char *func, ErrorClass err_class, const char *fmt, ...) - GCC_FMT_ATTR(6, 7); + G_GNUC_PRINTF(6, 7); /* * Make @errp parameter easier to use regardless of argument value diff --git a/include/qapi/qmp/qjson.h b/include/qapi/qmp/qjson.h index 593b40b4e0a49a8bba3bf61356b0d43db2e69ed4..7bd8d2de1b336c4a8ebf4e5804edc3a5d45d089d 100644 --- a/include/qapi/qmp/qjson.h +++ b/include/qapi/qmp/qjson.h @@ -17,13 +17,13 @@ QObject *qobject_from_json(const char *string, Error **errp); QObject *qobject_from_vjsonf_nofail(const char *string, va_list ap) - GCC_FMT_ATTR(1, 0); + G_GNUC_PRINTF(1, 0); QObject *qobject_from_jsonf_nofail(const char *string, ...) - GCC_FMT_ATTR(1, 2); + G_GNUC_PRINTF(1, 2); QDict *qdict_from_vjsonf_nofail(const char *string, va_list ap) - GCC_FMT_ATTR(1, 0); + G_GNUC_PRINTF(1, 0); QDict *qdict_from_jsonf_nofail(const char *string, ...) - GCC_FMT_ATTR(1, 2); + G_GNUC_PRINTF(1, 2); GString *qobject_to_json(const QObject *obj); GString *qobject_to_json_pretty(const QObject *obj, bool pretty); diff --git a/include/qemu/buffer.h b/include/qemu/buffer.h index d34d2c857ccc64cbc0780fa69e2858e234c1d7c2..e95dfd696ca8393822c0ee349f8ede3ca0e6ea91 100644 --- a/include/qemu/buffer.h +++ b/include/qemu/buffer.h @@ -49,7 +49,7 @@ struct Buffer { * to identify in debug traces. */ void buffer_init(Buffer *buffer, const char *name, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); /** * buffer_shrink: diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 3baa5e3790f7040689054db7a0d9092ba86c6bf0..f2bd050e3b9aa8809f20a1b8e3c575b61112743f 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -79,19 +79,12 @@ #define QEMU_BUILD_BUG_ON_ZERO(x) (sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)) - \ sizeof(QEMU_BUILD_BUG_ON_STRUCT(x))) -#if defined(__clang__) -/* clang doesn't support gnu_printf, so use printf. */ -# define GCC_FMT_ATTR(n, m) __attribute__((format(printf, n, m))) -#else -/* Use gnu_printf (qemu uses standard format strings). */ -# define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m))) -# if defined(_WIN32) +#if !defined(__clang__) && defined(_WIN32) /* * Map __printf__ to __gnu_printf__ because we want standard format strings even * when MinGW or GLib include files use __printf__. */ -# define __printf__ __gnu_printf__ -# endif +# define __printf__ __gnu_printf__ #endif #ifndef __has_warning diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h index 9d197daca387cf4f228bb680889372204305d143..33e662db44c69abea936500f6918da95d3ee438f 100644 --- a/include/qemu/error-report.h +++ b/include/qemu/error-report.h @@ -30,23 +30,23 @@ void loc_set_none(void); void loc_set_cmdline(char **argv, int idx, int cnt); void loc_set_file(const char *fname, int lno); -int error_vprintf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); -int error_printf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -int error_vprintf_unless_qmp(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); -int error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +int error_vprintf(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); +int error_printf(const char *fmt, ...) G_GNUC_PRINTF(1, 2); +int error_vprintf_unless_qmp(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); +int error_printf_unless_qmp(const char *fmt, ...) G_GNUC_PRINTF(1, 2); -void error_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); -void warn_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); -void info_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); +void error_vreport(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); +void warn_vreport(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); +void info_vreport(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); -void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -void warn_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -void info_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void error_report(const char *fmt, ...) G_GNUC_PRINTF(1, 2); +void warn_report(const char *fmt, ...) G_GNUC_PRINTF(1, 2); +void info_report(const char *fmt, ...) G_GNUC_PRINTF(1, 2); bool error_report_once_cond(bool *printed, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); bool warn_report_once_cond(bool *printed, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); void error_init(const char *argv0); diff --git a/include/qemu/log-for-trace.h b/include/qemu/log-for-trace.h index 2f0a5b080eabd6f26b390e9ee6f4c2fba8ff5935..5e415172278a2acd4528cff167814d9231a046de 100644 --- a/include/qemu/log-for-trace.h +++ b/include/qemu/log-for-trace.h @@ -30,6 +30,6 @@ static inline bool qemu_loglevel_mask(int mask) } /* main logging function */ -int GCC_FMT_ATTR(1, 2) qemu_log(const char *fmt, ...); +int G_GNUC_PRINTF(1, 2) qemu_log(const char *fmt, ...); #endif diff --git a/include/qemu/log.h b/include/qemu/log.h index 9b8066020729a7d027fd4eab9ab39de79ce7b5cc..5739c7e6d8192e9094cd0ee9e02c4868db082aa8 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -96,7 +96,7 @@ static inline void qemu_log_unlock(FILE *fd) /* vfprintf-like logging function */ -static inline void GCC_FMT_ATTR(1, 0) +static inline void G_GNUC_PRINTF(1, 0) qemu_log_vprintf(const char *fmt, va_list va) { QemuLogFile *logfile; diff --git a/include/qemu/qemu-print.h b/include/qemu/qemu-print.h index 40b596262fae5559a4d6bbd9da6c693b80a0cf6c..1b70920648b83e8beb49f0faff1cf8add3bc4e63 100644 --- a/include/qemu/qemu-print.h +++ b/include/qemu/qemu-print.h @@ -13,11 +13,11 @@ #ifndef QEMU_PRINT_H #define QEMU_PRINT_H -int qemu_vprintf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); -int qemu_printf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +int qemu_vprintf(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); +int qemu_printf(const char *fmt, ...) G_GNUC_PRINTF(1, 2); int qemu_vfprintf(FILE *stream, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); -int qemu_fprintf(FILE *stream, const char *fmt, ...) GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 0); +int qemu_fprintf(FILE *stream, const char *fmt, ...) G_GNUC_PRINTF(2, 3); #endif diff --git a/include/qemu/readline.h b/include/qemu/readline.h index e81258322be699fc3e93d7effba8d2c562d1ac2b..622aa4564f67041ebe409cfb0efb0ca8d4a3deed 100644 --- a/include/qemu/readline.h +++ b/include/qemu/readline.h @@ -5,7 +5,7 @@ #define READLINE_MAX_CMDS 64 #define READLINE_MAX_COMPLETIONS 256 -typedef void GCC_FMT_ATTR(2, 3) ReadLinePrintfFunc(void *opaque, +typedef void G_GNUC_PRINTF(2, 3) ReadLinePrintfFunc(void *opaque, const char *fmt, ...); typedef void ReadLineFlushFunc(void *opaque); typedef void ReadLineFunc(void *opaque, const char *str, diff --git a/io/channel-websock.c b/io/channel-websock.c index 70889bb54da5a0502619a978f8124d1dc6127512..55145a6a8c5d71e7735f391c1f7cbd9660877e45 100644 --- a/io/channel-websock.c +++ b/io/channel-websock.c @@ -157,7 +157,7 @@ enum { QIO_CHANNEL_WEBSOCK_OPCODE_PONG = 0xA }; -static void GCC_FMT_ATTR(2, 3) +static void G_GNUC_PRINTF(2, 3) qio_channel_websock_handshake_send_res(QIOChannelWebsock *ioc, const char *resmsg, ...) diff --git a/monitor/hmp.c b/monitor/hmp.c index 569066036dc17fe086ec9b682ab8cdcd75edab22..24fd2e5f34bf3ffe2a5edba3bd242d58c264e698 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -308,7 +308,7 @@ void help_cmd(Monitor *mon, const char *name) static const char *pch; static sigjmp_buf expr_env; -static void GCC_FMT_ATTR(2, 3) QEMU_NORETURN +static void G_GNUC_PRINTF(2, 3) QEMU_NORETURN expr_error(Monitor *mon, const char *fmt, ...) { va_list ap; @@ -1462,7 +1462,7 @@ static void monitor_event(void *opaque, QEMUChrEvent event) * These functions just adapt the readline interface in a typesafe way. We * could cast function pointers but that discards compiler checks. */ -static void GCC_FMT_ATTR(2, 3) monitor_readline_printf(void *opaque, +static void G_GNUC_PRINTF(2, 3) monitor_readline_printf(void *opaque, const char *fmt, ...) { MonitorHMP *mon = opaque; diff --git a/nbd/server.c b/nbd/server.c index 5da884c2fc354ed4eefff10f157055ed52f46cd4..735381aacfcbfb040c2f744196d03f8da64f8964 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -213,7 +213,7 @@ static int nbd_negotiate_send_rep(NBDClient *client, uint32_t type, /* Send an error reply. * Return -errno on error, 0 on success. */ -static int GCC_FMT_ATTR(4, 0) +static int G_GNUC_PRINTF(4, 0) nbd_negotiate_send_rep_verr(NBDClient *client, uint32_t type, Error **errp, const char *fmt, va_list va) { @@ -253,7 +253,7 @@ nbd_sanitize_name(const char *name) /* Send an error reply. * Return -errno on error, 0 on success. */ -static int GCC_FMT_ATTR(4, 5) +static int G_GNUC_PRINTF(4, 5) nbd_negotiate_send_rep_err(NBDClient *client, uint32_t type, Error **errp, const char *fmt, ...) { @@ -269,7 +269,7 @@ nbd_negotiate_send_rep_err(NBDClient *client, uint32_t type, /* Drop remainder of the current option, and send a reply with the * given error type and message. Return -errno on read or write * failure; or 0 if connection is still live. */ -static int GCC_FMT_ATTR(4, 0) +static int G_GNUC_PRINTF(4, 0) nbd_opt_vdrop(NBDClient *client, uint32_t type, Error **errp, const char *fmt, va_list va) { @@ -282,7 +282,7 @@ nbd_opt_vdrop(NBDClient *client, uint32_t type, Error **errp, return ret; } -static int GCC_FMT_ATTR(4, 5) +static int G_GNUC_PRINTF(4, 5) nbd_opt_drop(NBDClient *client, uint32_t type, Error **errp, const char *fmt, ...) { @@ -296,7 +296,7 @@ nbd_opt_drop(NBDClient *client, uint32_t type, Error **errp, return ret; } -static int GCC_FMT_ATTR(3, 4) +static int G_GNUC_PRINTF(3, 4) nbd_opt_invalid(NBDClient *client, Error **errp, const char *fmt, ...) { int ret; diff --git a/qemu-img.c b/qemu-img.c index 5dffb3e616010cca465bbcacd4c33862dda4a8b6..1caddfb23a7198c222740fb863a6210e8ece78a3 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -99,7 +99,7 @@ static void format_print(void *opaque, const char *name) printf(" %s", name); } -static void QEMU_NORETURN GCC_FMT_ATTR(1, 2) error_exit(const char *fmt, ...) +static void QEMU_NORETURN G_GNUC_PRINTF(1, 2) error_exit(const char *fmt, ...) { va_list ap; @@ -284,7 +284,7 @@ static QemuOptsList qemu_source_opts = { }, }; -static int GCC_FMT_ATTR(2, 3) qprintf(bool quiet, const char *fmt, ...) +static int G_GNUC_PRINTF(2, 3) qprintf(bool quiet, const char *fmt, ...) { int ret = 0; if (!quiet) { diff --git a/qemu-io.c b/qemu-io.c index 3924639b92bd2fd1e3a083d139febf623733c5ed..e45a15c41aac30f6a12964c344e1b1f53fec5b73 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -329,7 +329,7 @@ static char *get_prompt(void) return prompt; } -static void GCC_FMT_ATTR(2, 3) readline_printf_func(void *opaque, +static void G_GNUC_PRINTF(2, 3) readline_printf_func(void *opaque, const char *fmt, ...) { va_list ap; diff --git a/qga/guest-agent-core.h b/qga/guest-agent-core.h index 9d01ea9c82ab754443dcf1451be304d3f9ec5263..29cd50402fdb68f6493ff46cc9063c31ccb8fabc 100644 --- a/qga/guest-agent-core.h +++ b/qga/guest-agent-core.h @@ -36,7 +36,7 @@ void ga_command_state_free(GACommandState *cs); bool ga_logging_enabled(GAState *s); void ga_disable_logging(GAState *s); void ga_enable_logging(GAState *s); -void GCC_FMT_ATTR(1, 2) slog(const gchar *fmt, ...); +void G_GNUC_PRINTF(1, 2) slog(const gchar *fmt, ...); void ga_set_response_delimited(GAState *s); bool ga_is_frozen(GAState *s); void ga_set_frozen(GAState *s); diff --git a/qga/vss-win32/requester.h b/qga/vss-win32/requester.h index 5a8e8faf0cea35f84d273deb2900327c5ee171ac..ecc5f2acb4fde52f1b56111d5efae32ed24c2430 100644 --- a/qga/vss-win32/requester.h +++ b/qga/vss-win32/requester.h @@ -25,7 +25,7 @@ struct Error; typedef void (*ErrorSetFunc)(struct Error **errp, const char *src, int line, const char *func, int win32_err, const char *fmt, ...) - GCC_FMT_ATTR(6, 7); + G_GNUC_PRINTF(6, 7); typedef struct ErrorSet { ErrorSetFunc error_setg_win32_wrapper; struct Error **errp; /* restriction: must not be null */ diff --git a/qobject/json-parser.c b/qobject/json-parser.c index 008b326fb81add94b7565ccb14ea3c6d2f1f11a4..d498db6e7027e644521d6dbf10597a2f98efd476 100644 --- a/qobject/json-parser.c +++ b/qobject/json-parser.c @@ -54,7 +54,7 @@ static QObject *parse_value(JSONParserContext *ctxt); /** * Error handler */ -static void GCC_FMT_ATTR(3, 4) parse_error(JSONParserContext *ctxt, +static void G_GNUC_PRINTF(3, 4) parse_error(JSONParserContext *ctxt, JSONToken *token, const char *msg, ...) { va_list ap; diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index ddd8148d87e56bb058d59844cc1fddb835cdaf47..a07f0effb54089cce6c1dc63c1196582a716c53d 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -227,7 +227,7 @@ our $Attribute = qr{ QEMU_WARN_UNUSED_RESULT| QEMU_SENTINEL| QEMU_PACKED| - GCC_FMT_ATTR + G_GNUC_PRINTF }x; our $Modifier; our $Inline = qr{inline}; diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h index 20eea6b708f51c25ef4112f837dfd4c5a10912a2..c2fcea8e77a2d5bf9e3ea13e59b0479ef38fabff 100644 --- a/scripts/cocci-macro-file.h +++ b/scripts/cocci-macro-file.h @@ -34,7 +34,7 @@ #define QEMU_BUILD_BUG_ON(x) \ typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1] __attribute__((unused)); -#define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m))) +#define G_GNUC_PRINTF(n, m) __attribute__((format(gnu_printf, n, m))) #define xglue(x, y) x ## y #define glue(x, y) xglue(x, y) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 8b7cb6aa8e4611237a62722a6cd1d6d71adfff60..cc586233a974afbe630b1a8afb50ba13fcc0605a 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -288,7 +288,7 @@ static void qtest_send_prefix(CharBackend *chr) (long) tv.tv_sec, (long) tv.tv_usec); } -static void GCC_FMT_ATTR(1, 2) qtest_log_send(const char *fmt, ...) +static void G_GNUC_PRINTF(1, 2) qtest_log_send(const char *fmt, ...) { va_list ap; @@ -318,7 +318,7 @@ static void qtest_send(CharBackend *chr, const char *str) qtest_server_send(qtest_server_send_opaque, str); } -static void GCC_FMT_ATTR(2, 3) qtest_sendf(CharBackend *chr, +static void G_GNUC_PRINTF(2, 3) qtest_sendf(CharBackend *chr, const char *fmt, ...) { va_list ap; diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h index cf38d273f5c05af892b45111ede8e3a66e22df37..552667f17e37732b82e6c5b156ab50f2c6a063e8 100644 --- a/tests/qtest/libqos/libqtest.h +++ b/tests/qtest/libqos/libqtest.h @@ -31,7 +31,7 @@ typedef struct QTestState QTestState; * * Returns: #QTestState instance. */ -QTestState *qtest_initf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +QTestState *qtest_initf(const char *fmt, ...) G_GNUC_PRINTF(1, 2); /** * qtest_vinitf: @@ -43,7 +43,7 @@ QTestState *qtest_initf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); * * Returns: #QTestState instance. */ -QTestState *qtest_vinitf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); +QTestState *qtest_vinitf(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); /** * qtest_init: @@ -106,7 +106,7 @@ void qtest_quit(QTestState *s); */ QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, ...) - GCC_FMT_ATTR(4, 5); + G_GNUC_PRINTF(4, 5); /** * qtest_qmp: @@ -118,7 +118,7 @@ QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num, * Sends a QMP message to QEMU and returns the response. */ QDict *qtest_qmp(QTestState *s, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); /** * qtest_qmp_send: @@ -130,7 +130,7 @@ QDict *qtest_qmp(QTestState *s, const char *fmt, ...) * Sends a QMP message to QEMU and leaves the response in the stream. */ void qtest_qmp_send(QTestState *s, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); /** * qtest_qmp_send_raw: @@ -141,7 +141,7 @@ void qtest_qmp_send(QTestState *s, const char *fmt, ...) * this is useful for negative tests. */ void qtest_qmp_send_raw(QTestState *s, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); /** * qtest_socket_server: @@ -165,7 +165,7 @@ int qtest_socket_server(const char *socket_path); */ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) - GCC_FMT_ATTR(4, 0); + G_GNUC_PRINTF(4, 0); /** * qtest_vqmp: @@ -178,7 +178,7 @@ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num, * Sends a QMP message to QEMU and returns the response. */ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); + G_GNUC_PRINTF(2, 0); /** * qtest_qmp_vsend_fds: @@ -194,7 +194,7 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap) */ void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) - GCC_FMT_ATTR(4, 0); + G_GNUC_PRINTF(4, 0); /** * qtest_qmp_vsend: @@ -207,7 +207,7 @@ void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num, * Sends a QMP message to QEMU and leaves the response in the stream. */ void qtest_qmp_vsend(QTestState *s, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); + G_GNUC_PRINTF(2, 0); /** * qtest_qmp_receive_dict: @@ -269,7 +269,7 @@ QDict *qtest_qmp_event_ref(QTestState *s, const char *event); * * Returns: the command's output. The caller should g_free() it. */ -char *qtest_hmp(QTestState *s, const char *fmt, ...) GCC_FMT_ATTR(2, 3); +char *qtest_hmp(QTestState *s, const char *fmt, ...) G_GNUC_PRINTF(2, 3); /** * qtest_hmpv: @@ -283,7 +283,7 @@ char *qtest_hmp(QTestState *s, const char *fmt, ...) GCC_FMT_ATTR(2, 3); * Returns: the command's output. The caller should g_free() it. */ char *qtest_vhmp(QTestState *s, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); + G_GNUC_PRINTF(2, 0); void qtest_module_load(QTestState *s, const char *prefix, const char *libname); @@ -688,17 +688,17 @@ void qtest_remove_abrt_handler(void *data); * the response. */ void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); QDict *qmp_fd_receive(int fd); void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, - const char *fmt, va_list ap) GCC_FMT_ATTR(4, 0); -void qmp_fd_vsend(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); -void qmp_fd_send(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3); -void qmp_fd_send_raw(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3); -void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); -QDict *qmp_fdv(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); -QDict *qmp_fd(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3); + const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0); +void qmp_fd_vsend(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0); +void qmp_fd_send(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3); +void qmp_fd_send_raw(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3); +void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0); +QDict *qmp_fdv(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0); +QDict *qmp_fd(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3); /** * qtest_cb_for_every_machine: @@ -750,7 +750,7 @@ void qtest_qmp_device_add_qdict(QTestState *qts, const char *drv, * Generic hot-plugging test via the device_add QMP command. */ void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id, - const char *fmt, ...) GCC_FMT_ATTR(4, 5); + const char *fmt, ...) G_GNUC_PRINTF(4, 5); /** * qtest_qmp_add_client: diff --git a/tests/qtest/libqtest-single.h b/tests/qtest/libqtest-single.h index 0d7f568678e5ff01349ca3480db46d37795a6a76..b0838b9e0e710a533ecd2ea78be10a69317d151b 100644 --- a/tests/qtest/libqtest-single.h +++ b/tests/qtest/libqtest-single.h @@ -52,7 +52,7 @@ static inline void qtest_end(void) * * Sends a QMP message to QEMU and returns the response. */ -GCC_FMT_ATTR(1, 2) +G_GNUC_PRINTF(1, 2) static inline QDict *qmp(const char *fmt, ...) { va_list ap; diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 9dac018fcba05076074b02ea350198ac278af785..dc5566ccfd6034fb8c8c0b2bcd5bb54d0cc6eec8 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -437,7 +437,7 @@ static void qtest_client_socket_send(QTestState *s, const char *buf) socket_send(s->fd, buf, strlen(buf)); } -static void GCC_FMT_ATTR(2, 3) qtest_sendf(QTestState *s, const char *fmt, ...) +static void G_GNUC_PRINTF(2, 3) qtest_sendf(QTestState *s, const char *fmt, ...) { va_list ap; diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helpers.h index d63bba9630f9572fe4f33a4f606474d7ee63224c..555adafce129baadc12b55ab915f231c3cdd5baf 100644 --- a/tests/qtest/migration-helpers.h +++ b/tests/qtest/migration-helpers.h @@ -16,13 +16,13 @@ extern bool got_stop; -GCC_FMT_ATTR(3, 4) +G_GNUC_PRINTF(3, 4) QDict *wait_command_fd(QTestState *who, int fd, const char *command, ...); -GCC_FMT_ATTR(2, 3) +G_GNUC_PRINTF(2, 3) QDict *wait_command(QTestState *who, const char *command, ...); -GCC_FMT_ATTR(3, 4) +G_GNUC_PRINTF(3, 4) void migrate_qmp(QTestState *who, const char *uri, const char *fmt, ...); QDict *migrate_query(QTestState *who); diff --git a/tests/unit/test-qobject-input-visitor.c b/tests/unit/test-qobject-input-visitor.c index 6f59a7f43249fc12447d16c5a36ef0a4d6829d01..22538f8140995c66dec27cb9ea3a731892be7600 100644 --- a/tests/unit/test-qobject-input-visitor.c +++ b/tests/unit/test-qobject-input-visitor.c @@ -64,7 +64,7 @@ static Visitor *test_init_internal(TestInputVisitorData *data, bool keyval, return data->qiv; } -static GCC_FMT_ATTR(3, 4) +static G_GNUC_PRINTF(3, 4) Visitor *visitor_input_test_init_full(TestInputVisitorData *data, bool keyval, const char *json_string, ...) @@ -79,7 +79,7 @@ Visitor *visitor_input_test_init_full(TestInputVisitorData *data, return v; } -static GCC_FMT_ATTR(2, 3) +static G_GNUC_PRINTF(2, 3) Visitor *visitor_input_test_init(TestInputVisitorData *data, const char *json_string, ...) {