diff --git a/src/admin/admin_server_dispatch.c b/src/admin/admin_server_dispatch.c index 3c4d72dedbc8f8002172dfb38bb5bae2c8590ff6..f07ae6df1d92de3b52f82e022c035cd65ffaa7bc 100644 --- a/src/admin/admin_server_dispatch.c +++ b/src/admin/admin_server_dispatch.c @@ -135,7 +135,7 @@ get_nonnull_server(virNetDaemonPtr dmn, admin_nonnull_server srv) return virNetDaemonGetServer(dmn, srv.name); } -static int ATTRIBUTE_RETURN_CHECK +static int G_GNUC_WARN_UNUSED_RESULT make_nonnull_server(admin_nonnull_server *srv_dst, virNetServerPtr srv_src) { diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index d0854925e3b5a964714c29b6df28bf8c792b523e..d98fae775c08ac4a4b6197673da18831e9eb0b8f 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -186,7 +186,7 @@ void virDomainDeviceInfoFree(virDomainDeviceInfoPtr info); bool virDomainDeviceInfoAddressIsEqual(const virDomainDeviceInfo *a, const virDomainDeviceInfo *b) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; bool virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info, int type); diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c1705a07b659aa0067f9a04249405bd579891d92..35a51f17938a1bd7e0eefd2a6d960313ea686143 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17521,7 +17521,7 @@ virDomainChrFind(virDomainDefPtr def, /* Return the address within vmdef to be modified when working with a * chrdefptr of the given type. */ -static int ATTRIBUTE_RETURN_CHECK +static int G_GNUC_WARN_UNUSED_RESULT virDomainChrGetDomainPtrsInternal(virDomainDefPtr vmdef, virDomainChrDeviceType type, virDomainChrDefPtr ***arrPtr, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index f7404b814f39b93d870b4fd8ce6b18d81421dca7..e2edca149a9983393ce0344373ee2ff0b662cc59 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2814,7 +2814,7 @@ int virDomainDefSetVcpus(virDomainDefPtr def, unsigned int vcpus); unsigned int virDomainDefGetVcpus(const virDomainDef *def); virBitmapPtr virDomainDefGetOnlineVcpumap(const virDomainDef *def); virDomainVcpuDefPtr virDomainDefGetVcpu(virDomainDefPtr def, unsigned int vcpu) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void virDomainDefVcpuOrderClear(virDomainDefPtr def); int virDomainDefGetVcpusTopology(const virDomainDef *def, unsigned int *maxvcpus); @@ -2844,11 +2844,11 @@ int virDomainDiskGetType(virDomainDiskDefPtr def); void virDomainDiskSetType(virDomainDiskDefPtr def, int type); const char *virDomainDiskGetSource(virDomainDiskDef const *def); int virDomainDiskSetSource(virDomainDiskDefPtr def, const char *src) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void virDomainDiskEmptySource(virDomainDiskDefPtr def); const char *virDomainDiskGetDriver(const virDomainDiskDef *def); int virDomainDiskSetDriver(virDomainDiskDefPtr def, const char *name) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virDomainDiskGetFormat(virDomainDiskDefPtr def); void virDomainDiskSetFormat(virDomainDiskDefPtr def, int format); virDomainControllerDefPtr @@ -2910,7 +2910,7 @@ int virDomainDeviceInfoIterate(virDomainDefPtr def, bool virDomainDefHasDeviceAddress(virDomainDefPtr def, virDomainDeviceInfoPtr info) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; void virDomainDefFree(virDomainDefPtr vm); VIR_DEFINE_AUTOPTR_FUNC(virDomainDef, virDomainDefFree); @@ -3160,7 +3160,7 @@ virDomainDiskDefPtr virDomainDiskByName(virDomainDefPtr def, const char *virDomainDiskPathByName(virDomainDefPtr, const char *name); int virDomainDiskInsert(virDomainDefPtr def, virDomainDiskDefPtr disk) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void virDomainDiskInsertPreAlloced(virDomainDefPtr def, virDomainDiskDefPtr disk); int virDomainStorageNetworkParseHost(xmlNodePtr hostnode, @@ -3221,7 +3221,7 @@ int virDomainNetAppendIPAddress(virDomainNetDefPtr def, int virDomainControllerInsert(virDomainDefPtr def, virDomainControllerDefPtr controller) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void virDomainControllerInsertPreAlloced(virDomainDefPtr def, virDomainControllerDefPtr controller); int virDomainControllerFind(const virDomainDef *def, int type, int idx); @@ -3239,7 +3239,7 @@ int virDomainLeaseIndex(virDomainDefPtr def, int virDomainLeaseInsert(virDomainDefPtr def, virDomainLeaseDefPtr lease); int virDomainLeaseInsertPreAlloc(virDomainDefPtr def) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void virDomainLeaseInsertPreAlloced(virDomainDefPtr def, virDomainLeaseDefPtr lease); virDomainLeaseDefPtr @@ -3287,7 +3287,7 @@ int virDomainSaveConfig(const char *configDir, int virDomainSaveStatus(virDomainXMLOptionPtr xmlopt, const char *statusDir, virDomainObjPtr obj, - virCapsPtr caps) ATTRIBUTE_RETURN_CHECK; + virCapsPtr caps) G_GNUC_WARN_UNUSED_RESULT; typedef void (*virDomainLoadConfigNotify)(virDomainObjPtr dom, int newDomain, @@ -3357,29 +3357,29 @@ typedef const char* (*virEventActionToStringFunc)(int type); typedef int (*virEventActionFromStringFunc)(const char *type); int virDomainMemoryInsert(virDomainDefPtr def, virDomainMemoryDefPtr mem) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; virDomainMemoryDefPtr virDomainMemoryRemove(virDomainDefPtr def, int idx) ATTRIBUTE_NONNULL(1); int virDomainMemoryFindByDef(virDomainDefPtr def, virDomainMemoryDefPtr mem) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virDomainMemoryFindInactiveByDef(virDomainDefPtr def, virDomainMemoryDefPtr mem) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virDomainShmemDefInsert(virDomainDefPtr def, virDomainShmemDefPtr shmem) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; bool virDomainShmemDefEquals(virDomainShmemDefPtr src, virDomainShmemDefPtr dst) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; ssize_t virDomainShmemDefFind(virDomainDefPtr def, virDomainShmemDefPtr shmem) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; virDomainShmemDefPtr virDomainShmemDefRemove(virDomainDefPtr def, size_t idx) ATTRIBUTE_NONNULL(1); ssize_t virDomainInputDefFind(const virDomainDef *def, const virDomainInputDef *input) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; bool virDomainVsockDefEquals(const virDomainVsockDef *a, const virDomainVsockDef *b) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; VIR_ENUM_DECL(virDomainTaint); VIR_ENUM_DECL(virDomainVirt); @@ -3558,7 +3558,7 @@ virStorageSourcePtr virDomainStorageSourceParseBase(const char *type, const char *format, const char *index) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virDomainStorageSourceParse(xmlNodePtr node, xmlXPathContextPtr ctxt, @@ -3572,7 +3572,7 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt, virStorageSourcePtr src, unsigned int flags, virDomainXMLOptionPtr xmlopt) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def, int maplen, @@ -3580,7 +3580,7 @@ int virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def, unsigned char *cpumaps, int hostcpus, virBitmapPtr autoCpuset) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; bool virDomainDefHasMemballoon(const virDomainDef *def) ATTRIBUTE_NONNULL(1); diff --git a/src/conf/netdev_bandwidth_conf.h b/src/conf/netdev_bandwidth_conf.h index 42872cc4969686f7833f41451bec85870433b99d..898b2fb4286802a745049ddc064f0f71f448a747 100644 --- a/src/conf/netdev_bandwidth_conf.h +++ b/src/conf/netdev_bandwidth_conf.h @@ -28,7 +28,7 @@ int virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwidth, unsigned int *class_id, xmlNodePtr node, bool allowFloor) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBandwidthFormat(virNetDevBandwidthPtr def, unsigned int class_id, virBufferPtr buf); diff --git a/src/conf/virnetworkobj.h b/src/conf/virnetworkobj.h index a91b4304c6a2587c34e94b042c1f520ad41db37d..fe3ec5bbf825cf9485e3c9c0e07235bb8bffc466 100644 --- a/src/conf/virnetworkobj.h +++ b/src/conf/virnetworkobj.h @@ -202,7 +202,7 @@ virNetworkObjPortForEach(virNetworkObjPtr obj, int virNetworkObjSaveStatus(const char *statusDir, virNetworkObjPtr net, - virNetworkXMLOptionPtr xmlopt) ATTRIBUTE_RETURN_CHECK; + virNetworkXMLOptionPtr xmlopt) G_GNUC_WARN_UNUSED_RESULT; int virNetworkObjLoadAllConfigs(virNetworkObjListPtr nets, diff --git a/src/driver.h b/src/driver.h index faf4788a4f5f24a440e54fb8789d1054cfd89342..ca82ac974bc8965f7cb4366d6c03acd0587455d1 100644 --- a/src/driver.h +++ b/src/driver.h @@ -98,15 +98,15 @@ struct _virConnectDriver { }; int virRegisterConnectDriver(virConnectDriverPtr driver, - bool setSharedDrivers) ATTRIBUTE_RETURN_CHECK; -int virRegisterStateDriver(virStateDriverPtr driver) ATTRIBUTE_RETURN_CHECK; - -int virSetSharedInterfaceDriver(virInterfaceDriverPtr driver) ATTRIBUTE_RETURN_CHECK; -int virSetSharedNetworkDriver(virNetworkDriverPtr driver) ATTRIBUTE_RETURN_CHECK; -int virSetSharedNodeDeviceDriver(virNodeDeviceDriverPtr driver) ATTRIBUTE_RETURN_CHECK; -int virSetSharedNWFilterDriver(virNWFilterDriverPtr driver) ATTRIBUTE_RETURN_CHECK; -int virSetSharedSecretDriver(virSecretDriverPtr driver) ATTRIBUTE_RETURN_CHECK; -int virSetSharedStorageDriver(virStorageDriverPtr driver) ATTRIBUTE_RETURN_CHECK; + bool setSharedDrivers) G_GNUC_WARN_UNUSED_RESULT; +int virRegisterStateDriver(virStateDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; + +int virSetSharedInterfaceDriver(virInterfaceDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; +int virSetSharedNetworkDriver(virNetworkDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; +int virSetSharedNodeDeviceDriver(virNodeDeviceDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; +int virSetSharedNWFilterDriver(virNWFilterDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; +int virSetSharedSecretDriver(virSecretDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; +int virSetSharedStorageDriver(virStorageDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; bool virHasDriverForURIScheme(const char *scheme); diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c index 1684b8ed836ebb08864e7fee84b5973dc626e906..4e381db3efb801b96412f25436241ec0e07a9768 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -588,7 +588,7 @@ udevBridgeScanDirFilter(const struct dirent *entry) static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) -ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK +ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT udevGetIfaceDefBond(struct udev *udev, struct udev_device *dev, const char *name, @@ -813,7 +813,7 @@ udevGetIfaceDefBond(struct udev *udev, static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) -ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK +ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT udevGetIfaceDefBridge(struct udev *udev, struct udev_device *dev, const char *name, @@ -919,7 +919,7 @@ udevGetIfaceDefBridge(struct udev *udev, static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) -ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK +ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT udevGetIfaceDefVlan(struct udev *udev ATTRIBUTE_UNUSED, struct udev_device *dev ATTRIBUTE_UNUSED, const char *name, diff --git a/src/libxl/libxl_domain.h b/src/libxl/libxl_domain.h index 737ae6accd01cc4fc5d58f71e8ee32ee019b6351..7e280937221fdd1a602bd1229ce49c32b7e883dc 100644 --- a/src/libxl/libxl_domain.h +++ b/src/libxl/libxl_domain.h @@ -86,7 +86,7 @@ int libxlDomainObjBeginJob(libxlDriverPrivatePtr driver, virDomainObjPtr obj, enum libxlDomainJob job) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void libxlDomainObjEndJob(libxlDriverPrivatePtr driver, @@ -94,7 +94,7 @@ libxlDomainObjEndJob(libxlDriverPrivatePtr driver, int libxlDomainJobUpdateTime(struct libxlDomainJobObj *job) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; char * libxlDomainManagedSavePath(libxlDriverPrivatePtr driver, diff --git a/src/lxc/lxc_domain.h b/src/lxc/lxc_domain.h index 9cb7090b5b5ea58c7bccc72bf488cf1767293761..319f83338f9d93452f9d6ee9a66af8fd5f668b3a 100644 --- a/src/lxc/lxc_domain.h +++ b/src/lxc/lxc_domain.h @@ -99,7 +99,7 @@ int virLXCDomainObjBeginJob(virLXCDriverPtr driver, virDomainObjPtr obj, enum virLXCDomainJob job) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void virLXCDomainObjEndJob(virLXCDriverPtr driver, diff --git a/src/nwfilter/nwfilter_learnipaddr.h b/src/nwfilter/nwfilter_learnipaddr.h index 5b9294327ffdbc52c8ba0d4b287d5fafacbde011..2c214183a11ba158a3e3d9a5047f408fc1c554d6 100644 --- a/src/nwfilter/nwfilter_learnipaddr.h +++ b/src/nwfilter/nwfilter_learnipaddr.h @@ -42,7 +42,7 @@ int virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver, bool virNWFilterHasLearnReq(int ifindex); int virNWFilterTerminateLearnReq(const char *ifname); -int virNWFilterLockIface(const char *ifname) ATTRIBUTE_RETURN_CHECK; +int virNWFilterLockIface(const char *ifname) G_GNUC_WARN_UNUSED_RESULT; void virNWFilterUnlockIface(const char *ifname); int virNWFilterLearnInit(void); diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 2de614b1594e44afab19ca1a8800a23f234d6790..87525af1607360427688b403aebb0fbc0f05e288 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -178,12 +178,12 @@ int qemuBlockStorageSourceCreateGetFormatProps(virStorageSourcePtr src, virStorageSourcePtr backing, virJSONValuePtr *props) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; int qemuBlockStorageSourceCreateGetStorageProps(virStorageSourcePtr src, virJSONValuePtr *props) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int qemuBlockStorageSourceCreate(virDomainObjPtr vm, diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h index 417f253e313109d1b9d44f66fe69932740de5986..d8da918f2f93d83b29af651145ae7067280a2666 100644 --- a/src/qemu/qemu_blockjob.h +++ b/src/qemu/qemu_blockjob.h @@ -212,7 +212,7 @@ void qemuBlockJobSyncEnd(virDomainObjPtr vm, qemuBlockJobDataPtr qemuBlockJobGetByDisk(virDomainDiskDefPtr disk) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; qemuBlockjobState qemuBlockjobConvertMonitorStatus(int monitorstatus); diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h index 91d087794790b39669dee89896abe5796ab586e2..54839b5bfb1f7b06ad0d8dcf9184ba58ae903320 100644 --- a/src/qemu/qemu_cgroup.h +++ b/src/qemu/qemu_cgroup.h @@ -40,10 +40,10 @@ int qemuTeardownInputCgroup(virDomainObjPtr vm, virDomainInputDefPtr dev); int qemuSetupHostdevCgroup(virDomainObjPtr vm, virDomainHostdevDefPtr dev) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuTeardownHostdevCgroup(virDomainObjPtr vm, virDomainHostdevDefPtr dev) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuSetupMemoryDevicesCgroup(virDomainObjPtr vm, virDomainMemoryDefPtr mem); int qemuTeardownMemoryDevicesCgroup(virDomainObjPtr vm, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 01a54d4265f88c550c913b0053896b58ae2dc1df..282ab2c3eccb8c7d3f92fdcf0051395b81bf6a22 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -610,30 +610,30 @@ void qemuDomainEventEmitJobCompleted(virQEMUDriverPtr driver, int qemuDomainObjBeginJob(virQEMUDriverPtr driver, virDomainObjPtr obj, qemuDomainJob job) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuDomainObjBeginAgentJob(virQEMUDriverPtr driver, virDomainObjPtr obj, qemuDomainAgentJob agentJob) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuDomainObjBeginJobWithAgent(virQEMUDriverPtr driver, virDomainObjPtr obj, qemuDomainJob job, qemuDomainAgentJob agentJob) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj, qemuDomainAsyncJob asyncJob, virDomainJobOperation operation, unsigned long apiFlags) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuDomainObjBeginNestedJob(virQEMUDriverPtr driver, virDomainObjPtr obj, qemuDomainAsyncJob asyncJob) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuDomainObjBeginJobNowait(virQEMUDriverPtr driver, virDomainObjPtr obj, qemuDomainJob job) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void qemuDomainObjEndJob(virQEMUDriverPtr driver, virDomainObjPtr obj); @@ -662,11 +662,11 @@ void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver, int qemuDomainObjExitMonitor(virQEMUDriverPtr driver, virDomainObjPtr obj) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver, virDomainObjPtr obj, qemuDomainAsyncJob asyncJob) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; qemuAgentPtr qemuDomainObjEnterAgent(virDomainObjPtr obj) @@ -679,7 +679,7 @@ void qemuDomainObjEnterRemote(virDomainObjPtr obj) ATTRIBUTE_NONNULL(1); int qemuDomainObjExitRemote(virDomainObjPtr obj, bool checkActive) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; virDomainDefPtr qemuDomainDefCopy(virQEMUDriverPtr driver, virQEMUCapsPtr qemuCaps, @@ -843,7 +843,7 @@ int qemuDomainDiskGetBackendAlias(virDomainDiskDefPtr disk, virQEMUCapsPtr qemuCaps, char **backendAlias) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; int qemuDomainStorageSourceChainAccessAllow(virQEMUDriverPtr driver, virDomainObjPtr vm, @@ -1172,7 +1172,7 @@ qemuDomainPrepareDiskSourceData(virDomainDiskDefPtr disk, virStorageSourcePtr src, virQEMUDriverConfigPtr cfg, virQEMUCapsPtr qemuCaps) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int @@ -1220,4 +1220,4 @@ qemuDomainValidateActualNetDef(const virDomainNetDef *net, int qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/qemu/qemu_extdevice.h b/src/qemu/qemu_extdevice.h index a035c9f6380dbed028615356371a71e8f2f7789c..5cf777ab4b7a59f55fafe95a8f548038a716e36a 100644 --- a/src/qemu/qemu_extdevice.h +++ b/src/qemu/qemu_extdevice.h @@ -28,17 +28,17 @@ int qemuExtDeviceLogCommand(virQEMUDriverPtr driver, virCommandPtr cmd, const char *info) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuExtDevicesPrepareDomain(virQEMUDriverPtr driver, virDomainObjPtr vm) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuExtDevicesPrepareHost(virQEMUDriverPtr driver, virDomainObjPtr vm) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void qemuExtDevicesCleanupHost(virQEMUDriverPtr driver, virDomainDefPtr def) @@ -48,7 +48,7 @@ int qemuExtDevicesStart(virQEMUDriverPtr driver, virDomainObjPtr vm, bool incomingMigration) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void qemuExtDevicesStop(virQEMUDriverPtr driver, virDomainObjPtr vm) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a98ec2d55a151666ecb1498ca6607e6ae4d690b8..d75b879a56df1dcaa34b490a6d007747fa7a96f0 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -86,7 +86,7 @@ qemuMigrationJobStart(virQEMUDriverPtr driver, virDomainObjPtr vm, qemuDomainAsyncJob job, unsigned long apiFlags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; static void qemuMigrationJobSetPhase(virQEMUDriverPtr driver, diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index 188ccfa7fdb434d5d0852bcd5c12c15bbcf3b65e..2daae65191d1bb6027f27b0a07355f7b9d29e1e7 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -206,7 +206,7 @@ qemuMigrationSrcToFile(virQEMUDriverPtr driver, int fd, const char *compressor, qemuDomainAsyncJob asyncJob) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int qemuMigrationSrcCancel(virQEMUDriverPtr driver, diff --git a/src/qemu/qemu_tpm.h b/src/qemu/qemu_tpm.h index d5a27592fc5dc2226b38520b1806c0cbd8de6c76..3db0797fab077036245239d449160f776b4377cf 100644 --- a/src/qemu/qemu_tpm.h +++ b/src/qemu/qemu_tpm.h @@ -25,12 +25,12 @@ int qemuExtTPMInitPaths(virQEMUDriverPtr driver, virDomainDefPtr def) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuExtTPMPrepareHost(virQEMUDriverPtr driver, virDomainDefPtr def) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void qemuExtTPMCleanupHost(virDomainDefPtr def) ATTRIBUTE_NONNULL(1); @@ -39,7 +39,7 @@ int qemuExtTPMStart(virQEMUDriverPtr driver, virDomainObjPtr vm, bool incomingMigration) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void qemuExtTPMStop(virQEMUDriverPtr driver, virDomainObjPtr vm) @@ -49,4 +49,4 @@ int qemuExtTPMSetupCgroup(virQEMUDriverPtr driver, virDomainDefPtr def, virCgroupPtr cgroup) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/qemu/qemu_vhost_user_gpu.h b/src/qemu/qemu_vhost_user_gpu.h index 40a8567630abe50bf744113174ce175f69ccf52a..2c757fd8d1da0039796f3ee1852b9162d6616f1a 100644 --- a/src/qemu/qemu_vhost_user_gpu.h +++ b/src/qemu/qemu_vhost_user_gpu.h @@ -27,13 +27,13 @@ int qemuExtVhostUserGPUPrepareDomain(virQEMUDriverPtr driver, virDomainVideoDefPtr video) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int qemuExtVhostUserGPUStart(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainVideoDefPtr video) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void qemuExtVhostUserGPUStop(virQEMUDriverPtr driver, virDomainObjPtr def, @@ -46,4 +46,4 @@ qemuExtVhostUserGPUSetupCgroup(virQEMUDriverPtr driver, virDomainVideoDefPtr video, virCgroupPtr cgroup) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c index 9fc5dc3998e3970018984593997c513fafd36232..8c9390c1d2917fbdf97989636438070cdb6f3b26 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -95,18 +95,18 @@ static virNWFilterBindingPtr get_nonnull_nwfilter_binding(virConnectPtr conn, re static virDomainCheckpointPtr get_nonnull_domain_checkpoint(virDomainPtr dom, remote_nonnull_domain_checkpoint checkpoint); static virDomainSnapshotPtr get_nonnull_domain_snapshot(virDomainPtr dom, remote_nonnull_domain_snapshot snapshot); static virNodeDevicePtr get_nonnull_node_device(virConnectPtr conn, remote_nonnull_node_device dev); -static int make_nonnull_domain(remote_nonnull_domain *dom_dst, virDomainPtr dom_src) ATTRIBUTE_RETURN_CHECK; -static int make_nonnull_network(remote_nonnull_network *net_dst, virNetworkPtr net_src) ATTRIBUTE_RETURN_CHECK; -static int make_nonnull_network_port(remote_nonnull_network_port *port_dst, virNetworkPortPtr port_src) ATTRIBUTE_RETURN_CHECK; -static int make_nonnull_interface(remote_nonnull_interface *interface_dst, virInterfacePtr interface_src) ATTRIBUTE_RETURN_CHECK; -static int make_nonnull_storage_pool(remote_nonnull_storage_pool *pool_dst, virStoragePoolPtr pool_src) ATTRIBUTE_RETURN_CHECK; -static int make_nonnull_storage_vol(remote_nonnull_storage_vol *vol_dst, virStorageVolPtr vol_src) ATTRIBUTE_RETURN_CHECK; -static int make_nonnull_node_device(remote_nonnull_node_device *dev_dst, virNodeDevicePtr dev_src) ATTRIBUTE_RETURN_CHECK; -static int make_nonnull_secret(remote_nonnull_secret *secret_dst, virSecretPtr secret_src) ATTRIBUTE_RETURN_CHECK; -static int make_nonnull_nwfilter(remote_nonnull_nwfilter *net_dst, virNWFilterPtr nwfilter_src) ATTRIBUTE_RETURN_CHECK; -static int make_nonnull_nwfilter_binding(remote_nonnull_nwfilter_binding *binding_dst, virNWFilterBindingPtr binding_src) ATTRIBUTE_RETURN_CHECK; -static int make_nonnull_domain_checkpoint(remote_nonnull_domain_checkpoint *checkpoint_dst, virDomainCheckpointPtr checkpoint_src) ATTRIBUTE_RETURN_CHECK; -static int make_nonnull_domain_snapshot(remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src) ATTRIBUTE_RETURN_CHECK; +static int make_nonnull_domain(remote_nonnull_domain *dom_dst, virDomainPtr dom_src) G_GNUC_WARN_UNUSED_RESULT; +static int make_nonnull_network(remote_nonnull_network *net_dst, virNetworkPtr net_src) G_GNUC_WARN_UNUSED_RESULT; +static int make_nonnull_network_port(remote_nonnull_network_port *port_dst, virNetworkPortPtr port_src) G_GNUC_WARN_UNUSED_RESULT; +static int make_nonnull_interface(remote_nonnull_interface *interface_dst, virInterfacePtr interface_src) G_GNUC_WARN_UNUSED_RESULT; +static int make_nonnull_storage_pool(remote_nonnull_storage_pool *pool_dst, virStoragePoolPtr pool_src) G_GNUC_WARN_UNUSED_RESULT; +static int make_nonnull_storage_vol(remote_nonnull_storage_vol *vol_dst, virStorageVolPtr vol_src) G_GNUC_WARN_UNUSED_RESULT; +static int make_nonnull_node_device(remote_nonnull_node_device *dev_dst, virNodeDevicePtr dev_src) G_GNUC_WARN_UNUSED_RESULT; +static int make_nonnull_secret(remote_nonnull_secret *secret_dst, virSecretPtr secret_src) G_GNUC_WARN_UNUSED_RESULT; +static int make_nonnull_nwfilter(remote_nonnull_nwfilter *net_dst, virNWFilterPtr nwfilter_src) G_GNUC_WARN_UNUSED_RESULT; +static int make_nonnull_nwfilter_binding(remote_nonnull_nwfilter_binding *binding_dst, virNWFilterBindingPtr binding_src) G_GNUC_WARN_UNUSED_RESULT; +static int make_nonnull_domain_checkpoint(remote_nonnull_domain_checkpoint *checkpoint_dst, virDomainCheckpointPtr checkpoint_src) G_GNUC_WARN_UNUSED_RESULT; +static int make_nonnull_domain_snapshot(remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src) G_GNUC_WARN_UNUSED_RESULT; static int remoteSerializeDomainDiskErrors(virDomainDiskErrorPtr errors, diff --git a/src/rpc/virnetmessage.h b/src/rpc/virnetmessage.h index 748421a9fd1f48d2df01713a8a96cba2853b8990..94c29479749ad0852c8751184438e232339be5cd 100644 --- a/src/rpc/virnetmessage.h +++ b/src/rpc/virnetmessage.h @@ -66,20 +66,20 @@ void virNetMessageQueuePush(virNetMessagePtr *queue, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int virNetMessageEncodeHeader(virNetMessagePtr msg) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetMessageDecodeLength(virNetMessagePtr msg) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetMessageDecodeHeader(virNetMessagePtr msg) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetMessageEncodePayload(virNetMessagePtr msg, xdrproc_t filter, void *data) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetMessageDecodePayload(virNetMessagePtr msg, xdrproc_t filter, void *data) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetMessageEncodeNumFDs(virNetMessagePtr msg); int virNetMessageDecodeNumFDs(virNetMessagePtr msg); @@ -87,9 +87,9 @@ int virNetMessageDecodeNumFDs(virNetMessagePtr msg); int virNetMessageEncodePayloadRaw(virNetMessagePtr msg, const char *buf, size_t len) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetMessageEncodePayloadEmpty(virNetMessagePtr msg) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; void virNetMessageSaveError(virNetMessageErrorPtr rerr) ATTRIBUTE_NONNULL(1); diff --git a/src/secret/secret_util.h b/src/secret/secret_util.h index 4fe8f98aa54db9be722b851f952ade168567ab93..ff23df63b7205663ebf0496d2bd25b08ebf92f16 100644 --- a/src/secret/secret_util.h +++ b/src/secret/secret_util.h @@ -30,4 +30,4 @@ int virSecretGetSecretString(virConnectPtr conn, uint8_t **ret_secret, size_t *ret_secret_size) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4) - ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(5) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/storage/storage_driver.h b/src/storage/storage_driver.h index 64b3d8bbf89270515f3abe303b6af1930c590b45..7d82871852f99a3ab4703480e1ebec818a9646f0 100644 --- a/src/storage/storage_driver.h +++ b/src/storage/storage_driver.h @@ -36,7 +36,7 @@ storagePoolLookupByTargetPath(virConnectPtr conn, char *virStoragePoolObjBuildTempFilePath(virStoragePoolObjPtr obj, virStorageVolDefPtr voldef) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int storageRegister(void); int storageRegisterAll(void); diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h index 705e23631d0143bbe5672f035396780902351e59..18c4cf85f3a3c20ba6d0eed0557321be518efee3 100644 --- a/src/storage/storage_util.h +++ b/src/storage/storage_util.h @@ -147,7 +147,7 @@ enum { int virStorageBackendVolOpen(const char *path, struct stat *sb, unsigned int flags) - ATTRIBUTE_RETURN_CHECK + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); #define VIR_STORAGE_DEFAULT_POOL_PERM_MODE 0711 diff --git a/src/util/viralloc.h b/src/util/viralloc.h index 49bf2b86e7f09033dc084859cc5ac55c01f91e7d..c503bbe19b41f7b903400bbf8f0a3bafa3ea69f6 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@ -54,26 +54,26 @@ /* Don't call these directly - use the macros below */ int virAlloc(void *ptrptr, size_t size) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1); int virAllocN(void *ptrptr, size_t size, size_t count) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1); int virReallocN(void *ptrptr, size_t size, size_t count) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1); int virExpandN(void *ptrptr, size_t size, size_t *count, size_t add) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); int virResizeN(void *ptrptr, size_t size, size_t *alloc, size_t count, size_t desired) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); void virShrinkN(void *ptrptr, size_t size, size_t *count, size_t toremove) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); int virInsertElementsN(void *ptrptr, size_t size, size_t at, size_t *countptr, size_t add, void *newelem, bool clearOriginal, bool inPlace) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); int virDeleteElementsN(void *ptrptr, size_t size, size_t at, size_t *countptr, size_t toremove, bool inPlace) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); int virAllocVar(void *ptrptr, size_t struct_size, size_t element_size, size_t count) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1); void virFree(void *ptrptr) ATTRIBUTE_NONNULL(1); void virDispose(void *ptrptr, size_t count, size_t element_size, size_t *countptr) diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h index 46696e0c70d3bb60fca5d3300fef605f8aceaaa2..8d700c88c55c170e076278c11a2663451be49073 100644 --- a/src/util/virbitmap.h +++ b/src/util/virbitmap.h @@ -33,9 +33,9 @@ typedef virBitmap *virBitmapPtr; /* * Allocate a bitmap capable of containing @size bits. */ -virBitmapPtr virBitmapNewQuiet(size_t size) ATTRIBUTE_RETURN_CHECK; -virBitmapPtr virBitmapNew(size_t size) ATTRIBUTE_RETURN_CHECK; -virBitmapPtr virBitmapNewEmpty(void) ATTRIBUTE_RETURN_CHECK; +virBitmapPtr virBitmapNewQuiet(size_t size) G_GNUC_WARN_UNUSED_RESULT; +virBitmapPtr virBitmapNew(size_t size) G_GNUC_WARN_UNUSED_RESULT; +virBitmapPtr virBitmapNewEmpty(void) G_GNUC_WARN_UNUSED_RESULT; /* * Free previously allocated bitmap @@ -52,38 +52,38 @@ int virBitmapCopy(virBitmapPtr dst, virBitmapPtr src); * Set bit position @b in @bitmap */ int virBitmapSetBit(virBitmapPtr bitmap, size_t b) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virBitmapSetBitExpand(virBitmapPtr bitmap, size_t b) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; /* * Clear bit position @b in @bitmap */ int virBitmapClearBit(virBitmapPtr bitmap, size_t b) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virBitmapClearBitExpand(virBitmapPtr bitmap, size_t b) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; /* * Get bit @b in @bitmap. Returns false if b is out of range. */ bool virBitmapIsBitSet(virBitmapPtr bitmap, size_t b) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; /* * Get setting of bit position @b in @bitmap and store in @result */ int virBitmapGetBit(virBitmapPtr bitmap, size_t b, bool *result) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; virBitmapPtr virBitmapNewString(const char *string) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; char *virBitmapToString(virBitmapPtr bitmap, bool prefix, bool trim) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; char *virBitmapFormat(virBitmapPtr bitmap); diff --git a/src/util/vircommand.h b/src/util/vircommand.h index 632d02bc7108a51d16a0cf88b620b91e2b14419c..6bc1ef87b0efa75c93de7bcdd377118cac95a979 100644 --- a/src/util/vircommand.h +++ b/src/util/vircommand.h @@ -33,9 +33,9 @@ typedef virCommand *virCommandPtr; * call any function that is not async-signal-safe. */ typedef int (*virExecHook)(void *data); -pid_t virFork(void) ATTRIBUTE_RETURN_CHECK; +pid_t virFork(void) G_GNUC_WARN_UNUSED_RESULT; -int virRun(const char *const*argv, int *status) ATTRIBUTE_RETURN_CHECK; +int virRun(const char *const*argv, int *status) G_GNUC_WARN_UNUSED_RESULT; virCommandPtr virCommandNew(const char *binary) ATTRIBUTE_NONNULL(1); @@ -172,26 +172,26 @@ void virCommandSetPreExecHook(virCommandPtr cmd, void virCommandWriteArgLog(virCommandPtr cmd, int logfd); -char *virCommandToString(virCommandPtr cmd, bool linebreaks) ATTRIBUTE_RETURN_CHECK; +char *virCommandToString(virCommandPtr cmd, bool linebreaks) G_GNUC_WARN_UNUSED_RESULT; -int virCommandExec(virCommandPtr cmd, gid_t *groups, int ngroups) ATTRIBUTE_RETURN_CHECK; +int virCommandExec(virCommandPtr cmd, gid_t *groups, int ngroups) G_GNUC_WARN_UNUSED_RESULT; int virCommandRun(virCommandPtr cmd, - int *exitstatus) ATTRIBUTE_RETURN_CHECK; + int *exitstatus) G_GNUC_WARN_UNUSED_RESULT; int virCommandRunAsync(virCommandPtr cmd, - pid_t *pid) ATTRIBUTE_RETURN_CHECK; + pid_t *pid) G_GNUC_WARN_UNUSED_RESULT; int virCommandWait(virCommandPtr cmd, - int *exitstatus) ATTRIBUTE_RETURN_CHECK; + int *exitstatus) G_GNUC_WARN_UNUSED_RESULT; void virCommandRequireHandshake(virCommandPtr cmd); int virCommandHandshakeWait(virCommandPtr cmd) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virCommandHandshakeNotify(virCommandPtr cmd) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void virCommandAbort(virCommandPtr cmd); diff --git a/src/util/vircrypto.h b/src/util/vircrypto.h index 826169276e9976f080cc755b6134c3158110fe59..bf002d42d5920e40824ed110e221835c2de555af 100644 --- a/src/util/vircrypto.h +++ b/src/util/vircrypto.h @@ -45,14 +45,14 @@ virCryptoHashBuf(virCryptoHash hash, const char *input, unsigned char *output) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virCryptoHashString(virCryptoHash hash, const char *input, char **output) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; bool virCryptoHaveCipher(virCryptoCipher algorithm); @@ -62,4 +62,4 @@ int virCryptoEncryptData(virCryptoCipher algorithm, uint8_t *data, size_t datalen, uint8_t **ciphertext, size_t *ciphertextlen) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(6) - ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(9) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(9) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virfile.h b/src/util/virfile.h index f22380550cd1ae1415eef1d8c47e5bc5be3575ea..a66e3569a3e71ea01df55e801a810656a90e9fd8 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -37,19 +37,19 @@ typedef enum { VIR_FILE_CLOSE_DONT_LOG = 1 << 2, } virFileCloseFlags; -ssize_t saferead(int fd, void *buf, size_t count) ATTRIBUTE_RETURN_CHECK; +ssize_t saferead(int fd, void *buf, size_t count) G_GNUC_WARN_UNUSED_RESULT; ssize_t safewrite(int fd, const void *buf, size_t count) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int safezero(int fd, off_t offset, off_t len) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virFileAllocate(int fd, off_t offset, off_t len) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; /* Don't call these directly - use the macros below */ int virFileClose(int *fdptr, virFileCloseFlags flags) - ATTRIBUTE_RETURN_CHECK; -int virFileFclose(FILE **file, bool preserve_errno) ATTRIBUTE_RETURN_CHECK; -FILE *virFileFdopen(int *fdptr, const char *mode) ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; +int virFileFclose(FILE **file, bool preserve_errno) G_GNUC_WARN_UNUSED_RESULT; +FILE *virFileFdopen(int *fdptr, const char *mode) G_GNUC_WARN_UNUSED_RESULT; static inline void virForceCloseHelper(int *fd) { @@ -107,7 +107,7 @@ typedef enum { virFileWrapperFdPtr virFileWrapperFdNew(int *fd, const char *name, unsigned int flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virFileWrapperFdClose(virFileWrapperFdPtr dfd); @@ -146,20 +146,20 @@ int virFileNBDDeviceAssociate(const char *file, int virFileDeleteTree(const char *dir); int virFileReadHeaderFD(int fd, int maxlen, char **buf) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(3); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(3); int virFileReadHeaderQuiet(const char *path, int maxlen, char **buf) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); int virFileReadLimFD(int fd, int maxlen, char **buf) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(3); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(3); int virFileReadAll(const char *path, int maxlen, char **buf) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); int virFileReadAllQuiet(const char *path, int maxlen, char **buf) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); int virFileReadBufQuiet(const char *file, char *buf, int len) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int virFileWriteStr(const char *path, const char *str, mode_t mode) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virFileLinkPointsTo(const char *checkLink, const char *checkDest) @@ -170,15 +170,15 @@ int virFileRelLinkPointsTo(const char *directory, ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int virFileResolveLink(const char *linkpath, - char **resultpath) ATTRIBUTE_RETURN_CHECK; + char **resultpath) G_GNUC_WARN_UNUSED_RESULT; int virFileResolveAllLinks(const char *linkpath, - char **resultpath) ATTRIBUTE_RETURN_CHECK; + char **resultpath) G_GNUC_WARN_UNUSED_RESULT; int virFileIsLink(const char *linkpath) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virFileReadLink(const char *linkpath, char **resultpath) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; char *virFindFileInPath(const char *file); @@ -219,16 +219,16 @@ int virFileIsSharedFSType(const char *path, int fstypes) ATTRIBUTE_NONNULL(1); int virFileIsSharedFS(const char *path) ATTRIBUTE_NONNULL(1); int virFileIsMountPoint(const char *file) ATTRIBUTE_NONNULL(1); int virFileIsCDROM(const char *path) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virFileGetMountSubtree(const char *mtabpath, const char *prefix, char ***mountsret, - size_t *nmountsret) ATTRIBUTE_RETURN_CHECK; + size_t *nmountsret) G_GNUC_WARN_UNUSED_RESULT; int virFileGetMountReverseSubtree(const char *mtabpath, const char *prefix, char ***mountsret, - size_t *nmountsret) ATTRIBUTE_RETURN_CHECK; + size_t *nmountsret) G_GNUC_WARN_UNUSED_RESULT; char *virFileSanitizePath(const char *path); char *virFileCanonicalizePath(const char *path) ATTRIBUTE_NOINLINE; @@ -242,15 +242,15 @@ enum { }; int virFileAccessibleAs(const char *path, int mode, uid_t uid, gid_t gid) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virFileOpenAs(const char *path, int openflags, mode_t mode, uid_t uid, gid_t gid, unsigned int flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virFileRemove(const char *path, uid_t uid, gid_t gid); int virFileChownFiles(const char *name, uid_t uid, gid_t gid) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; enum { VIR_DIR_CREATE_NONE = 0, @@ -258,27 +258,27 @@ enum { VIR_DIR_CREATE_ALLOW_EXIST = (1 << 1), }; int virDirCreate(const char *path, mode_t mode, uid_t uid, gid_t gid, - unsigned int flags) ATTRIBUTE_RETURN_CHECK; + unsigned int flags) G_GNUC_WARN_UNUSED_RESULT; int virDirOpen(DIR **dirp, const char *dirname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virDirOpenIfExists(DIR **dirp, const char *dirname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virDirOpenQuiet(DIR **dirp, const char *dirname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virDirRead(DIR *dirp, struct dirent **ent, const char *dirname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; void virDirClose(DIR **dirp) ATTRIBUTE_NONNULL(1); #define VIR_DIR_CLOSE(dir) virDirClose(&(dir)) -int virFileMakePath(const char *path) ATTRIBUTE_RETURN_CHECK; +int virFileMakePath(const char *path) G_GNUC_WARN_UNUSED_RESULT; int virFileMakePathWithMode(const char *path, - mode_t mode) ATTRIBUTE_RETURN_CHECK; -int virFileMakeParentPath(const char *path) ATTRIBUTE_RETURN_CHECK; + mode_t mode) G_GNUC_WARN_UNUSED_RESULT; +int virFileMakeParentPath(const char *path) G_GNUC_WARN_UNUSED_RESULT; char *virFileBuildPath(const char *dir, const char *name, - const char *ext) ATTRIBUTE_RETURN_CHECK; + const char *ext) G_GNUC_WARN_UNUSED_RESULT; #ifdef WIN32 @@ -304,7 +304,7 @@ char *virFileBuildPath(const char *dir, bool virFileIsAbsPath(const char *path); int virFileAbsPath(const char *path, - char **abspath) ATTRIBUTE_RETURN_CHECK; + char **abspath) G_GNUC_WARN_UNUSED_RESULT; const char *virFileSkipRoot(const char *path); void virFileRemoveLastComponent(char *path); diff --git a/src/util/viriptables.h b/src/util/viriptables.h index feea988acd169bd8e825bf655caf035639c53a9f..de2695617854c66573d82ac0c23a7884ea984d9f 100644 --- a/src/util/viriptables.h +++ b/src/util/viriptables.h @@ -59,38 +59,38 @@ int iptablesAddForwardAllowOut (virFirewallPtr fw, unsigned int prefix, const char *iface, const char *physdev) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int iptablesRemoveForwardAllowOut (virFirewallPtr fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, const char *physdev) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int iptablesAddForwardAllowRelatedIn(virFirewallPtr fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, const char *physdev) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int iptablesRemoveForwardAllowRelatedIn(virFirewallPtr fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, const char *physdev) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int iptablesAddForwardAllowIn (virFirewallPtr fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, const char *physdev) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int iptablesRemoveForwardAllowIn (virFirewallPtr fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, const char *physdev) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void iptablesAddForwardAllowCross (virFirewallPtr fw, virFirewallLayer layer, @@ -120,7 +120,7 @@ int iptablesAddForwardMasquerade (virFirewallPtr fw, virSocketAddrRangePtr addr, virPortRangePtr port, const char *protocol) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int iptablesRemoveForwardMasquerade (virFirewallPtr fw, virSocketAddr *netaddr, unsigned int prefix, @@ -128,19 +128,19 @@ int iptablesRemoveForwardMasquerade (virFirewallPtr fw, virSocketAddrRangePtr addr, virPortRangePtr port, const char *protocol) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int iptablesAddDontMasquerade (virFirewallPtr fw, virSocketAddr *netaddr, unsigned int prefix, const char *physdev, const char *destaddr) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int iptablesRemoveDontMasquerade (virFirewallPtr fw, virSocketAddr *netaddr, unsigned int prefix, const char *physdev, const char *destaddr) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void iptablesAddOutputFixUdpChecksum (virFirewallPtr fw, const char *iface, int port); diff --git a/src/util/viriscsi.h b/src/util/viriscsi.h index 6eddb504a25d103ebd22ad89f4b6dfaaeec4eda7..6d17d139ebe7241e4eb125f38f92ee7845c92820 100644 --- a/src/util/viriscsi.h +++ b/src/util/viriscsi.h @@ -33,18 +33,18 @@ virISCSIConnectionLogin(const char *portal, const char *initiatoriqn, const char *target) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virISCSIConnectionLogout(const char *portal, const char *initiatoriqn, const char *target) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virISCSIRescanLUNs(const char *session) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virISCSIScanTargets(const char *portal, @@ -52,13 +52,13 @@ virISCSIScanTargets(const char *portal, bool persist, size_t *ntargetsret, char ***targetsret) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virISCSINodeNew(const char *portal, const char *target) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virISCSINodeUpdate(const char *portal, @@ -66,4 +66,4 @@ virISCSINodeUpdate(const char *portal, const char *name, const char *value) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virjson.h b/src/util/virjson.h index 65b8d5620a47df906252665ec31da26073f33668..b1d0d0e741c907f03ddb6ccdafbb8fa14ddddd4e 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h @@ -147,7 +147,7 @@ char *virJSONValueToString(virJSONValuePtr object, int virJSONValueToBuffer(virJSONValuePtr object, virBufferPtr buf, bool pretty) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; typedef int (*virJSONValueObjectIteratorFunc)(const char *key, virJSONValuePtr value, diff --git a/src/util/virkeyfile.h b/src/util/virkeyfile.h index 4cae4331fcea85b206b235bfe069ac3625e4eedc..4fdac0daf760109ed167bd2f9bc09733b6891945 100644 --- a/src/util/virkeyfile.h +++ b/src/util/virkeyfile.h @@ -33,13 +33,13 @@ virKeyFilePtr virKeyFileNew(void); int virKeyFileLoadFile(virKeyFilePtr conf, const char *filename) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virKeyFileLoadData(virKeyFilePtr conf, const char *filename, const char *data, size_t len) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; void virKeyFileFree(virKeyFilePtr conf); diff --git a/src/util/virmacaddr.h b/src/util/virmacaddr.h index 55cfd12164541244efb2218d5912bdf648393d6b..cf26a8bbfabe1eebb5df307ab53f9d27e92b11b9 100644 --- a/src/util/virmacaddr.h +++ b/src/util/virmacaddr.h @@ -54,10 +54,10 @@ const char *virMacAddrFormat(const virMacAddr *addr, void virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN], virMacAddrPtr addr) ATTRIBUTE_NOINLINE; int virMacAddrParse(const char* str, - virMacAddrPtr addr) ATTRIBUTE_RETURN_CHECK; + virMacAddrPtr addr) G_GNUC_WARN_UNUSED_RESULT; int virMacAddrParseHex(const char* str, virMacAddrPtr addr) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; bool virMacAddrIsUnicast(const virMacAddr *addr); bool virMacAddrIsMulticast(const virMacAddr *addr); bool virMacAddrIsBroadcastRaw(const unsigned char s[VIR_MAC_BUFLEN]); diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 6ff98487cb8cd50e3c299009a97d9430a574f7ad..ff8df31a378b35349168416494349c2f1223af10 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -147,87 +147,87 @@ struct _virNetDevCoalesce { int virNetDevSetupControl(const char *ifname, virIfreq *ifr) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevExists(const char *brname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NOINLINE; int virNetDevSetOnline(const char *ifname, bool online) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NOINLINE; int virNetDevGetOnline(const char *ifname, bool *online) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetMAC(const char *ifname, const virMacAddr *macaddr) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NOINLINE; int virNetDevGetMAC(const char *ifname, virMacAddrPtr macaddr) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevReplaceMacAddress(const char *linkdev, const virMacAddr *macaddress, const char *stateDir) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevRestoreMacAddress(const char *linkdev, const char *stateDir) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetCoalesce(const char *ifname, virNetDevCoalescePtr coalesce, bool update) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetMTU(const char *ifname, int mtu) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetMTUFromDevice(const char *ifname, const char *otherifname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetMTU(const char *ifname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetNamespace(const char *ifname, pid_t pidInNs) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetName(const char *ifname, const char *newifname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; char *virNetDevGetName(int ifindex) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetIndex(const char *ifname, int *ifindex) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetVLanID(const char *ifname, int *vlanid) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetMaster(const char *ifname, char **master) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevValidateConfig(const char *ifname, const virMacAddr *macaddr, int ifindex) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevIsVirtualFunction(const char *ifname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetVirtualFunctionIndex(const char *pfname, const char *vfname, int *vf_index) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetPhysicalFunction(const char *ifname, char **pfname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevPFGetVF(const char *pfname, int vf, char **vfname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetPhysPortID(const char *ifname, char **physPortID) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetVirtualFunctions(const char *pfname, char ***vfname, @@ -235,12 +235,12 @@ int virNetDevGetVirtualFunctions(const char *pfname, size_t *n_vfname, unsigned int *max_vfs) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSaveNetConfig(const char *linkdev, int vf, const char *stateDir, bool saveVlan) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; int virNetDevReadNetConfig(const char *linkdev, int vf, @@ -249,7 +249,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf, virNetDevVlanPtr *vlan, virMacAddrPtr *MAC) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) - ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetNetConfig(const char *linkdev, int vf, @@ -257,7 +257,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf, virNetDevVlanPtr vlan, const virMacAddr *MAC, bool setVLan) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname, int *vf) @@ -265,40 +265,40 @@ int virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname, int virNetDevGetFeatures(const char *ifname, virBitmapPtr *out) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetLinkInfo(const char *ifname, virNetDevIfLinkPtr lnk) ATTRIBUTE_NONNULL(1); virNetDevRxFilterPtr virNetDevRxFilterNew(void) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; void virNetDevRxFilterFree(virNetDevRxFilterPtr filter); int virNetDevGetRxFilter(const char *ifname, virNetDevRxFilterPtr *filter) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevAddMulti(const char *ifname, virMacAddrPtr macaddr) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevDelMulti(const char *ifname, virMacAddrPtr macaddr) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetPromiscuous(const char *ifname, bool promiscuous) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetPromiscuous(const char *ifname, bool *promiscuous) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetRcvMulti(const char *ifname, bool receive) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetRcvMulti(const char *ifname, bool *receive) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetRcvAllMulti(const char *ifname, bool receive) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetRcvAllMulti(const char *ifname, bool *receive) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; #define SYSFS_NET_DIR "/sys/class/net/" #define SYSFS_INFINIBAND_DIR "/sys/class/infiniband/" @@ -306,7 +306,7 @@ int virNetDevSysfsFile(char **pf_sysfs_device_link, const char *ifname, const char *file) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NOINLINE; int virNetDevRunEthernetScript(const char *ifname, const char *script) ATTRIBUTE_NOINLINE; diff --git a/src/util/virnetdevbandwidth.h b/src/util/virnetdevbandwidth.h index 75da1f7ba6310a101a8a411d3b3c52df7598afa6..19323c5ed2eb182f4ff8a1102d7e5d0f44754024 100644 --- a/src/util/virnetdevbandwidth.h +++ b/src/util/virnetdevbandwidth.h @@ -42,11 +42,11 @@ int virNetDevBandwidthSet(const char *ifname, virNetDevBandwidthPtr bandwidth, bool hierarchical_class, bool swapped) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevBandwidthClear(const char *ifname); int virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest, const virNetDevBandwidth *src) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; bool virNetDevBandwidthEqual(virNetDevBandwidthPtr a, virNetDevBandwidthPtr b); @@ -56,20 +56,20 @@ int virNetDevBandwidthPlug(const char *brname, virNetDevBandwidthPtr bandwidth, unsigned int id) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevBandwidthUnplug(const char *brname, unsigned int id) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBandwidthUpdateRate(const char *ifname, unsigned int id, virNetDevBandwidthPtr bandwidth, unsigned long long new_rate) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBandwidthUpdateFilter(const char *ifname, const virMacAddr *ifmac_ptr, unsigned int id) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevbridge.h b/src/util/virnetdevbridge.h index 8df5e51c2e3f24c19dd03af791817b01034c1343..88284d6beda4031d4009ad02262ddb6d81fa1d99 100644 --- a/src/util/virnetdevbridge.h +++ b/src/util/virnetdevbridge.h @@ -22,56 +22,56 @@ #include "virmacaddr.h" int virNetDevBridgeCreate(const char *brname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgeDelete(const char *brname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgeAddPort(const char *brname, const char *ifname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgeRemovePort(const char *brname, const char *ifname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgeSetSTPDelay(const char *brname, int delay) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgeGetSTPDelay(const char *brname, int *delay) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgeSetSTP(const char *brname, bool enable) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgeGetSTP(const char *brname, bool *enable) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgeSetVlanFiltering(const char *brname, bool enable) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgeGetVlanFiltering(const char *brname, bool *enable) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgePortGetLearning(const char *brname, const char *ifname, bool *enable) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgePortSetLearning(const char *brname, const char *ifname, bool enable) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgePortGetUnicastFlood(const char *brname, const char *ifname, bool *enable) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgePortSetUnicastFlood(const char *brname, const char *ifname, bool enable) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; typedef enum { VIR_NETDEVBRIDGE_FDB_FLAG_ROUTER = (1 << 0), @@ -84,7 +84,7 @@ typedef enum { int virNetDevBridgeFDBAdd(const virMacAddr *mac, const char *ifname, unsigned int flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBridgeFDBDel(const virMacAddr *mac, const char *ifname, unsigned int flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevip.h b/src/util/virnetdevip.h index 9fa5f446b08f89f2f100c5a3ba4963fc13ec1abe..43271f827b003162f9ea8b5bf07246b02d74856e 100644 --- a/src/util/virnetdevip.h +++ b/src/util/virnetdevip.h @@ -63,20 +63,20 @@ int virNetDevIPAddrAdd(const char *ifname, virSocketAddr *addr, virSocketAddr *peer, unsigned int prefix) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NOINLINE; int virNetDevIPRouteAdd(const char *ifname, virSocketAddrPtr addr, unsigned int prefix, virSocketAddrPtr gateway, unsigned int metric) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevIPAddrDel(const char *ifname, virSocketAddr *addr, unsigned int prefix) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevIPAddrGet(const char *ifname, virSocketAddrPtr addr) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevIPWaitDadFinish(virSocketAddrPtr *addrs, size_t count) ATTRIBUTE_NONNULL(1); bool virNetDevIPCheckIPv6Forwarding(void); diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h index 24b17b4bd01e818f745efeb7a3f1b3900e0b9e25..4c153dfb5c922f3605880e67f875e08b510180da 100644 --- a/src/util/virnetdevmacvlan.h +++ b/src/util/virnetdevmacvlan.h @@ -58,7 +58,7 @@ int virNetDevMacVLanReserveName(const char *name, bool quietfail); int virNetDevMacVLanReleaseName(const char *name); bool virNetDevMacVLanIsMacvtap(const char *ifname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NOINLINE; int virNetDevMacVLanCreate(const char *ifname, const char *type, @@ -67,10 +67,10 @@ int virNetDevMacVLanCreate(const char *ifname, uint32_t macvlan_mode, int *retry) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevMacVLanDelete(const char *ifname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevMacVLanCreateWithVPortProfile(const char *ifname, const virMacAddr *macaddress, @@ -86,16 +86,16 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname, size_t tapfdSize, unsigned int flags) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(6) - ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(10) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(10) G_GNUC_WARN_UNUSED_RESULT; int virNetDevMacVLanTapOpen(const char *ifname, int *tapfd, size_t tapfdSize) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevMacVLanTapSetup(int *tapfd, size_t tapfdSize, bool vnet_hdr) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname, const virMacAddr *macaddress, @@ -104,7 +104,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname, virNetDevVPortProfilePtr virtPortProfile, char *stateDir) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_NONNULL(6) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(6) G_GNUC_WARN_UNUSED_RESULT; int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname, const virMacAddr *macaddress, @@ -113,7 +113,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname, virNetDevVPortProfilePtr virtPortProfile, virNetDevVPortProfileOp vmOp) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname, const virMacAddr *macaddress, @@ -122,4 +122,4 @@ int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname, virNetDevVPortProfilePtr virtPortProfile, virNetDevVPortProfileOp vmOp) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) -ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; +ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevmidonet.h b/src/util/virnetdevmidonet.h index aa7fe49103ac01f82c82b8884dd8dd40ff7877b1..61927c3edd5c9172c9da205756965566ebb8682e 100644 --- a/src/util/virnetdevmidonet.h +++ b/src/util/virnetdevmidonet.h @@ -24,7 +24,7 @@ int virNetDevMidonetBindPort(const char *ifname, virNetDevVPortProfilePtr virtualport) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevMidonetUnbindPort(virNetDevVPortProfilePtr virtualport) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitch.h index 5bc18f851f997cb907cc1ebca77cff586274b2da..b70ee7a559c53b1000e66f78452f986f826c2371 100644 --- a/src/util/virnetdevopenvswitch.h +++ b/src/util/virnetdevopenvswitch.h @@ -35,35 +35,35 @@ int virNetDevOpenvswitchAddPort(const char *brname, virNetDevVPortProfilePtr ovsport, virNetDevVlanPtr virtVlan) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevOpenvswitchRemovePort(const char *brname, const char *ifname) - ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevOpenvswitchInterfaceGetMaster(const char *ifname, char **master) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevOpenvswitchGetMigrateData(char **migrate, const char *ifname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevOpenvswitchSetMigrateData(char *migrate, const char *ifname) - ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevOpenvswitchInterfaceParseStats(const char *json, virDomainInterfaceStatsPtr stats) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevOpenvswitchInterfaceStats(const char *ifname, virDomainInterfaceStatsPtr stats) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevOpenvswitchInterfaceGetMaster(const char *ifname, char **master) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevOpenvswitchGetVhostuserIfname(const char *path, char **ifname) - ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; + ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NOINLINE; int virNetDevOpenvswitchUpdateVlan(const char *ifname, virNetDevVlanPtr virtVlan) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h index ec5789959a360346e380e7228f317da897140a25..36c2be777e70aa36c9198d45647bb39ddbdd40f2 100644 --- a/src/util/virnetdevtap.h +++ b/src/util/virnetdevtap.h @@ -34,17 +34,17 @@ int virNetDevTapCreate(char **ifname, int *tapfd, size_t tapfdSize, unsigned int flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NOINLINE; int virNetDevTapDelete(const char *ifname, const char *tunpath) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevTapGetName(int tapfd, char **ifname) - ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; char* virNetDevTapGetRealDeviceName(char *ifname) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NOINLINE; typedef enum { VIR_NETDEV_TAP_CREATE_NONE = 0, @@ -68,7 +68,7 @@ virNetDevTapAttachBridge(const char *tapname, unsigned int mtu, unsigned int *actualMTU) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevTapReattachBridge(const char *tapname, @@ -80,7 +80,7 @@ virNetDevTapReattachBridge(const char *tapname, unsigned int mtu, unsigned int *actualMTU) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetDevTapCreateInBridgePort(const char *brname, char **ifname, @@ -96,9 +96,9 @@ int virNetDevTapCreateInBridgePort(const char *brname, unsigned int *actualMTU, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NOINLINE; int virNetDevTapInterfaceStats(const char *ifname, virDomainInterfaceStatsPtr stats, bool swapped) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevveth.h b/src/util/virnetdevveth.h index 4380b7cfe1656b2c4a460d31b9092ded5019bbc9..830b37d046467bbb46da1b34a77f3c553aa32a53 100644 --- a/src/util/virnetdevveth.h +++ b/src/util/virnetdevveth.h @@ -23,6 +23,6 @@ /* Function declarations */ int virNetDevVethCreate(char **veth1, char **veth2) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevVethDelete(const char *veth) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprofile.h index d1db8bac6aed299e326ae5955285671eb422e06d..5fdd019a09bac2aff5fa6d1c9fbce29fddbf01be 100644 --- a/src/util/virnetdevvportprofile.h +++ b/src/util/virnetdevvportprofile.h @@ -99,7 +99,7 @@ int virNetDevVPortProfileAssociate(const char *ifname, const unsigned char *vmuuid, virNetDevVPortProfileOp vmOp, bool setlink_only) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int virNetDevVPortProfileDisassociate(const char *ifname, const virNetDevVPortProfile *virtPort, @@ -107,4 +107,4 @@ int virNetDevVPortProfileDisassociate(const char *ifname, const char *linkdev, int vf, virNetDevVPortProfileOp vmOp) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h index 6419a775e17d5c653a2b7c927b98ba0a346bf59e..a7e455769d31aa80b7dab8d0f535134334c8fc53 100644 --- a/src/util/virnetlink.h +++ b/src/util/virnetlink.h @@ -109,7 +109,7 @@ int virNetlinkGetErrorCode(struct nlmsghdr *resp, unsigned int recvbuflen); int virNetlinkDumpLink(const char *ifname, int ifindex, void **nlData, struct nlattr **tb, uint32_t src_pid, uint32_t dst_pid) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virNetlinkGetNeighbor(void **nlData, uint32_t src_pid, uint32_t dst_pid); diff --git a/src/util/virpci.h b/src/util/virpci.h index f3226f1f1b9b55207989d8f779b5e7e62e542ae2..017545424da7253b52090ab1ed59cb8a7c1f5a70 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -228,7 +228,7 @@ int virPCIGetNetName(const char *device_link_sysfs_path, int virPCIGetSysfsFile(char *virPCIDeviceName, char **pci_sysfs_device_link) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; bool virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr, bool report); diff --git a/src/util/virpidfile.h b/src/util/virpidfile.h index a42b82ff1d64f6887c14e914dff94676d23023f8..370a59892ed71a1d983fa3f9947eaf4036bdc50b 100644 --- a/src/util/virpidfile.h +++ b/src/util/virpidfile.h @@ -30,24 +30,24 @@ char *virPidFileBuildPath(const char *dir, const char *name); int virPidFileWritePath(const char *path, - pid_t pid) ATTRIBUTE_RETURN_CHECK; + pid_t pid) G_GNUC_WARN_UNUSED_RESULT; int virPidFileWrite(const char *dir, const char *name, - pid_t pid) ATTRIBUTE_RETURN_CHECK; + pid_t pid) G_GNUC_WARN_UNUSED_RESULT; int virPidFileReadPath(const char *path, - pid_t *pid) ATTRIBUTE_RETURN_CHECK; + pid_t *pid) G_GNUC_WARN_UNUSED_RESULT; int virPidFileRead(const char *dir, const char *name, - pid_t *pid) ATTRIBUTE_RETURN_CHECK; + pid_t *pid) G_GNUC_WARN_UNUSED_RESULT; int virPidFileReadPathIfAlive(const char *path, pid_t *pid, - const char *binpath) ATTRIBUTE_RETURN_CHECK; + const char *binpath) G_GNUC_WARN_UNUSED_RESULT; int virPidFileReadIfAlive(const char *dir, const char *name, pid_t *pid, - const char *binpath) ATTRIBUTE_RETURN_CHECK; + const char *binpath) G_GNUC_WARN_UNUSED_RESULT; int virPidFileDeletePath(const char *path); int virPidFileDelete(const char *dir, @@ -56,11 +56,11 @@ int virPidFileDelete(const char *dir, int virPidFileAcquirePath(const char *path, bool waitForLock, - pid_t pid) ATTRIBUTE_RETURN_CHECK; + pid_t pid) G_GNUC_WARN_UNUSED_RESULT; int virPidFileAcquire(const char *dir, const char *name, bool waitForLock, - pid_t pid) ATTRIBUTE_RETURN_CHECK; + pid_t pid) G_GNUC_WARN_UNUSED_RESULT; int virPidFileReleasePath(const char *path, int fd); diff --git a/src/util/virprocess.h b/src/util/virprocess.h index 8e2af33c7df7d77e74f1653093f6e7888fb31ef8..b2a3a0a7a69f879fa54ec127417eed8293900734 100644 --- a/src/util/virprocess.h +++ b/src/util/virprocess.h @@ -50,7 +50,7 @@ void virProcessExitWithStatus(int status) G_GNUC_NORETURN; int virProcessWait(pid_t pid, int *exitstatus, bool raw) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virProcessKill(pid_t pid, int sig); diff --git a/src/util/virrandom.h b/src/util/virrandom.h index c33932e8b3040d1095ec736f46419a8be8b36348..60f9aaf5300a6ab9f7e7fca3b23d521f7b1bcd52 100644 --- a/src/util/virrandom.h +++ b/src/util/virrandom.h @@ -24,5 +24,5 @@ uint64_t virRandomBits(int nbits) ATTRIBUTE_NOINLINE; double virRandom(void); uint32_t virRandomInt(uint32_t max); int virRandomBytes(unsigned char *buf, size_t buflen) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NOINLINE; int virRandomGenerateWWN(char **wwn, const char *virt_type) ATTRIBUTE_NOINLINE; diff --git a/src/util/virstring.h b/src/util/virstring.h index af6e234d836b16fa71022ea748ffb56df525e41d..a7ef9a36a70828e61d650aa3677ace2621bebc76 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -63,55 +63,55 @@ int virStrToLong_i(char const *s, char **end_ptr, int base, int *result) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virStrToLong_ui(char const *s, char **end_ptr, int base, unsigned int *result) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virStrToLong_uip(char const *s, char **end_ptr, int base, unsigned int *result) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virStrToLong_l(char const *s, char **end_ptr, int base, long *result) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virStrToLong_ul(char const *s, char **end_ptr, int base, unsigned long *result) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virStrToLong_ulp(char const *s, char **end_ptr, int base, unsigned long *result) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virStrToLong_ll(char const *s, char **end_ptr, int base, long long *result) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virStrToLong_ull(char const *s, char **end_ptr, int base, unsigned long long *result) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virStrToLong_ullp(char const *s, char **end_ptr, int base, unsigned long long *result) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virStrToDouble(char const *s, char **end_ptr, double *result) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virDoubleToStr(char **strp, double number) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; void virSkipSpaces(const char **str) ATTRIBUTE_NONNULL(1); void virSkipSpacesAndBackslash(const char **str) ATTRIBUTE_NONNULL(1); @@ -122,23 +122,23 @@ void virSkipSpacesBackwards(const char *str, char **endp) bool virStringIsEmpty(const char *str); int virStrncpy(char *dest, const char *src, size_t n, size_t destbytes) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virStrcpy(char *dest, const char *src, size_t destbytes) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; #define virStrcpyStatic(dest, src) virStrcpy((dest), (src), sizeof(dest)) /* Don't call these directly - use the macros below */ int virStrdup(char **dest, const char *src) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1); int virStrndup(char **dest, const char *src, ssize_t n) - ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1); + G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1); int virAsprintfInternal(char **strp, const char *fmt, ...) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 3) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virVasprintfInternal(char **strp, const char *fmt, va_list list) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 0) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; /** * VIR_STRDUP: @@ -276,7 +276,7 @@ bool virStringHasSuffix(const char *str, bool virStringHasCaseSuffix(const char *str, const char *suffix); bool virStringStripSuffix(char *str, - const char *suffix) ATTRIBUTE_RETURN_CHECK; + const char *suffix) G_GNUC_WARN_UNUSED_RESULT; bool virStringMatchesNameSuffix(const char *file, const char *name, const char *suffix); @@ -295,11 +295,11 @@ void virStringTrimOptionalNewline(char *str); int virStringParsePort(const char *str, unsigned int *port) - ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virStringParseYesNo(const char *str, bool *result) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; /** * VIR_AUTOSTRINGLIST: * diff --git a/src/util/virthread.h b/src/util/virthread.h index 6bbc09fa13df2dfa4063e77d20fb46f6a8f82609..a7960e444a19dce298cb4e30ae861a07cc9562f3 100644 --- a/src/util/virthread.h +++ b/src/util/virthread.h @@ -92,7 +92,7 @@ int virThreadCreateFull(virThreadPtr thread, virThreadFunc func, const char *funcName, bool worker, - void *opaque) ATTRIBUTE_RETURN_CHECK; + void *opaque) G_GNUC_WARN_UNUSED_RESULT; void virThreadSelf(virThreadPtr thread); bool virThreadIsSelf(virThreadPtr thread); void virThreadJoin(virThreadPtr thread); @@ -121,17 +121,17 @@ unsigned long long virThreadID(virThreadPtr thread); * } */ int virOnce(virOnceControlPtr once, virOnceFunc init) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int virMutexInit(virMutexPtr m) ATTRIBUTE_RETURN_CHECK; -int virMutexInitRecursive(virMutexPtr m) ATTRIBUTE_RETURN_CHECK; +int virMutexInit(virMutexPtr m) G_GNUC_WARN_UNUSED_RESULT; +int virMutexInitRecursive(virMutexPtr m) G_GNUC_WARN_UNUSED_RESULT; void virMutexDestroy(virMutexPtr m); void virMutexLock(virMutexPtr m); void virMutexUnlock(virMutexPtr m); -int virRWLockInit(virRWLockPtr m) ATTRIBUTE_RETURN_CHECK; +int virRWLockInit(virRWLockPtr m) G_GNUC_WARN_UNUSED_RESULT; void virRWLockDestroy(virRWLockPtr m); void virRWLockRead(virRWLockPtr m); @@ -139,7 +139,7 @@ void virRWLockWrite(virRWLockPtr m); void virRWLockUnlock(virRWLockPtr m); -int virCondInit(virCondPtr c) ATTRIBUTE_RETURN_CHECK; +int virCondInit(virCondPtr c) G_GNUC_WARN_UNUSED_RESULT; int virCondDestroy(virCondPtr c); /* virCondWait, virCondWaitUntil: @@ -147,8 +147,8 @@ int virCondDestroy(virCondPtr c); * changing value. Therefore in nearly all cases they * should be enclosed in a while loop that checks the predicate. */ -int virCondWait(virCondPtr c, virMutexPtr m) ATTRIBUTE_RETURN_CHECK; -int virCondWaitUntil(virCondPtr c, virMutexPtr m, unsigned long long whenms) ATTRIBUTE_RETURN_CHECK; +int virCondWait(virCondPtr c, virMutexPtr m) G_GNUC_WARN_UNUSED_RESULT; +int virCondWaitUntil(virCondPtr c, virMutexPtr m, unsigned long long whenms) G_GNUC_WARN_UNUSED_RESULT; void virCondSignal(virCondPtr c); void virCondBroadcast(virCondPtr c); @@ -156,9 +156,9 @@ void virCondBroadcast(virCondPtr c); typedef void (*virThreadLocalCleanup)(void *); int virThreadLocalInit(virThreadLocalPtr l, - virThreadLocalCleanup c) ATTRIBUTE_RETURN_CHECK; + virThreadLocalCleanup c) G_GNUC_WARN_UNUSED_RESULT; void *virThreadLocalGet(virThreadLocalPtr l); -int virThreadLocalSet(virThreadLocalPtr l, void*) ATTRIBUTE_RETURN_CHECK; +int virThreadLocalSet(virThreadLocalPtr l, void*) G_GNUC_WARN_UNUSED_RESULT; /** diff --git a/src/util/virthreadpool.h b/src/util/virthreadpool.h index 7dfb511c0a749ad76b11bd2465691064a44f8f15..5a55e22489b3d94a1a7d7bc355030decb373c55e 100644 --- a/src/util/virthreadpool.h +++ b/src/util/virthreadpool.h @@ -50,7 +50,7 @@ void virThreadPoolFree(virThreadPoolPtr pool); int virThreadPoolSendJob(virThreadPoolPtr pool, unsigned int priority, void *jobdata) ATTRIBUTE_NONNULL(1) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virThreadPoolSetParameters(virThreadPoolPtr pool, long long int minWorkers, diff --git a/src/util/virtime.h b/src/util/virtime.h index b8ea38e29103f5a1257e6c5e747aceae380d07d8..d4fba4aff50e77cc360518ba0f0779bec5322c49 100644 --- a/src/util/virtime.h +++ b/src/util/virtime.h @@ -40,26 +40,26 @@ void virTimeFieldsThen(unsigned long long when, struct tm *fields) /* These APIs are async signal safe and return -1, setting * errno on failure */ int virTimeMillisNowRaw(unsigned long long *now) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virTimeFieldsNowRaw(struct tm *fields) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virTimeStringNowRaw(char *buf) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virTimeStringThenRaw(unsigned long long when, char *buf) - ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; /* These APIs are *not* async signal safe and return -1, * raising a libvirt error on failure */ int virTimeMillisNow(unsigned long long *now) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virTimeFieldsNow(struct tm *fields) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; char *virTimeStringNow(void); char *virTimeStringThen(unsigned long long when); int virTimeLocalOffsetFromUTC(long *offset) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; typedef struct { unsigned long long start_t; diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h index 2c998978ea250cab5401784a8475cdc9e50ba715..0e39a191203541ca43bb7e99f9aaed9e7c1770fd 100644 --- a/src/util/virtypedparam.h +++ b/src/util/virtypedparam.h @@ -62,7 +62,7 @@ struct _virTypedParameterRemote { int virTypedParamsValidate(virTypedParameterPtr params, int nparams, /* const char *name, int type ... */ ...) - G_GNUC_NULL_TERMINATED ATTRIBUTE_RETURN_CHECK; + G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT; bool virTypedParamsCheck(virTypedParameterPtr params, int nparams, @@ -79,12 +79,12 @@ virTypedParamsFilter(virTypedParameterPtr params, int nparams, const char *name, virTypedParameterPtr **ret) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virTypedParameterAssign(virTypedParameterPtr param, const char *name, int type, /* TYPE arg */ ...) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virTypedParamsReplaceString(virTypedParameterPtr *params, int *nparams, @@ -149,34 +149,34 @@ int virTypedParamListAddInt(virTypedParamListPtr list, int value, const char *namefmt, ...) - ATTRIBUTE_FMT_PRINTF(3, 4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_FMT_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; int virTypedParamListAddUInt(virTypedParamListPtr list, unsigned int value, const char *namefmt, ...) - ATTRIBUTE_FMT_PRINTF(3, 4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_FMT_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; int virTypedParamListAddLLong(virTypedParamListPtr list, long long value, const char *namefmt, ...) - ATTRIBUTE_FMT_PRINTF(3, 4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_FMT_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; int virTypedParamListAddULLong(virTypedParamListPtr list, unsigned long long value, const char *namefmt, ...) - ATTRIBUTE_FMT_PRINTF(3, 4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_FMT_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; int virTypedParamListAddString(virTypedParamListPtr list, const char *value, const char *namefmt, ...) - ATTRIBUTE_FMT_PRINTF(3, 4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_FMT_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; int virTypedParamListAddBoolean(virTypedParamListPtr list, bool value, const char *namefmt, ...) - ATTRIBUTE_FMT_PRINTF(3, 4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_FMT_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; int virTypedParamListAddDouble(virTypedParamListPtr list, double value, const char *namefmt, ...) - ATTRIBUTE_FMT_PRINTF(3, 4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_FMT_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virutil.h b/src/util/virutil.h index 15ae67dea2ee3082b7520cd8fb04c6cc419a77d9..d265d698d086ef13bfb1ec8f852f4aae2eb8aab4 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -27,11 +27,11 @@ #include -int virSetBlocking(int fd, bool blocking) ATTRIBUTE_RETURN_CHECK; -int virSetNonBlock(int fd) ATTRIBUTE_RETURN_CHECK; -int virSetInherit(int fd, bool inherit) ATTRIBUTE_RETURN_CHECK; -int virSetCloseExec(int fd) ATTRIBUTE_RETURN_CHECK; -int virSetSockReuseAddr(int fd, bool fatal) ATTRIBUTE_RETURN_CHECK; +int virSetBlocking(int fd, bool blocking) G_GNUC_WARN_UNUSED_RESULT; +int virSetNonBlock(int fd) G_GNUC_WARN_UNUSED_RESULT; +int virSetInherit(int fd, bool inherit) G_GNUC_WARN_UNUSED_RESULT; +int virSetCloseExec(int fd) G_GNUC_WARN_UNUSED_RESULT; +int virSetSockReuseAddr(int fd, bool fatal) G_GNUC_WARN_UNUSED_RESULT; int virSetUIDGID(uid_t uid, gid_t gid, gid_t *groups, int ngroups); int virSetUIDGIDWithCaps(uid_t uid, gid_t gid, gid_t *groups, int ngroups, @@ -42,7 +42,7 @@ void virWaitForDevices(void); int virScaleInteger(unsigned long long *value, const char *suffix, unsigned long long scale, unsigned long long limit) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virHexToBin(unsigned char c); @@ -50,7 +50,7 @@ int virParseVersionString(const char *str, unsigned long *version, bool allowMissing); char *virFormatIntDecimal(char *buf, size_t buflen, int val) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; unsigned long long virFormatIntPretty(unsigned long long val, @@ -108,9 +108,9 @@ char *virGetGroupName(gid_t gid) ATTRIBUTE_NOINLINE; int virGetGroupList(uid_t uid, gid_t group, gid_t **groups) ATTRIBUTE_NONNULL(3); int virGetUserID(const char *name, - uid_t *uid) ATTRIBUTE_RETURN_CHECK; + uid_t *uid) G_GNUC_WARN_UNUSED_RESULT; int virGetGroupID(const char *name, - gid_t *gid) ATTRIBUTE_RETURN_CHECK; + gid_t *gid) G_GNUC_WARN_UNUSED_RESULT; bool virDoesUserExist(const char *name); bool virDoesGroupExist(const char *name); diff --git a/src/util/viruuid.h b/src/util/viruuid.h index b709c182ff9a341bb0e1d2eec881f91a7f02cb9d..54fbd8880508b76bc9daf1e2565f6b8ff27dca71 100644 --- a/src/util/viruuid.h +++ b/src/util/viruuid.h @@ -49,7 +49,7 @@ int virUUIDGenerate(unsigned char *uuid) ATTRIBUTE_NOINLINE; int virUUIDParse(const char *uuidstr, unsigned char *uuid) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; const char *virUUIDFormat(const unsigned char *uuid, char *uuidstr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); diff --git a/src/util/virxml.h b/src/util/virxml.h index 39e5a988a2d98993d7af525907ea64291ac9d65f..c7def9ce61537978a4dc5592e509f42e05bd6bea 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -31,7 +31,7 @@ #include "virautoclean.h" xmlXPathContextPtr virXMLXPathContextNew(xmlDocPtr xml) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; int virXPathBoolean(const char *xpath, xmlXPathContextPtr ctxt); @@ -221,7 +221,7 @@ virXMLFormatElement(virBufferPtr buf, const char *name, virBufferPtr attrBuf, virBufferPtr childBuf) - ATTRIBUTE_RETURN_CHECK; + G_GNUC_WARN_UNUSED_RESULT; struct _virXPathContextNodeSave { xmlXPathContextPtr ctxt; diff --git a/tools/virsh-domain-monitor.h b/tools/virsh-domain-monitor.h index 77e83502db49a1f46e21b1cdef26c05caa8c8b21..11a9156ae21fd4c748a129055e986efa03a72eab 100644 --- a/tools/virsh-domain-monitor.h +++ b/tools/virsh-domain-monitor.h @@ -24,6 +24,6 @@ char *virshGetDomainDescription(vshControl *ctl, virDomainPtr dom, bool title, unsigned int flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; extern const vshCmdDef domMonitoringCmds[]; diff --git a/tools/virsh-util.h b/tools/virsh-util.h index 7fdd39dd12ad529efb9b30fba3560cfad1608046..955d34dcfc645ba88b5296fd49b026f5e4509949 100644 --- a/tools/virsh-util.h +++ b/tools/virsh-util.h @@ -98,7 +98,7 @@ virshDomainGetXMLFromDom(vshControl *ctl, xmlDocPtr *xml, xmlXPathContextPtr *ctxt) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4) - ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(5) G_GNUC_WARN_UNUSED_RESULT; int virshDomainGetXML(vshControl *ctl, @@ -107,4 +107,4 @@ virshDomainGetXML(vshControl *ctl, xmlDocPtr *xml, xmlXPathContextPtr *ctxt) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4) - ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(5) G_GNUC_WARN_UNUSED_RESULT; diff --git a/tools/vsh.h b/tools/vsh.h index 4e02bb177dffbb363a2817f5367be8de321aba85..947904f6c076b858e17b7c8507d1585da4063657 100644 --- a/tools/vsh.h +++ b/tools/vsh.h @@ -255,39 +255,39 @@ bool vshCmdGrpHelp(vshControl *ctl, const vshCmdGrp *grp); int vshCommandOptInt(vshControl *ctl, const vshCmd *cmd, const char *name, int *value) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int vshCommandOptUInt(vshControl *ctl, const vshCmd *cmd, const char *name, unsigned int *value) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int vshCommandOptUIntWrap(vshControl *ctl, const vshCmd *cmd, const char *name, unsigned int *value) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int vshCommandOptUL(vshControl *ctl, const vshCmd *cmd, const char *name, unsigned long *value) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int vshCommandOptULWrap(vshControl *ctl, const vshCmd *cmd, const char *name, unsigned long *value) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int vshCommandOptStringQuiet(vshControl *ctl, const vshCmd *cmd, const char *name, const char **value) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int vshCommandOptStringReq(vshControl *ctl, const vshCmd *cmd, const char *name, const char **value) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int vshCommandOptLongLong(vshControl *ctl, const vshCmd *cmd, const char *name, long long *value) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int vshCommandOptULongLong(vshControl *ctl, const vshCmd *cmd, const char *name, unsigned long long *value) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int vshCommandOptULongLongWrap(vshControl *ctl, const vshCmd *cmd, const char *name, unsigned long long *value) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int vshCommandOptScaledInt(vshControl *ctl, const vshCmd *cmd, const char *name, unsigned long long *value, int scale, unsigned long long max) - ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; + ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; int vshBlockJobOptionBandwidth(vshControl *ctl, const vshCmd *cmd, bool bytes,