From 1b04a3832663cd0e790638646d78c0ee1a83098a Mon Sep 17 00:00:00 2001 From: Martin Belanger Date: Thu, 27 Apr 2023 10:13:19 -0400 Subject: [PATCH] python/swig: Wrap swig-sensitive struct inside #ifwdef SWIG To suppress the warnings generated by swig when parsing anonymous struct/union, we simply wrap the offending struct/union in a "#ifndef SWIG" statement. This is an acceptable workaround because we don't need to generate Python bindings for these structs. In fact, we specifically tell swig to not generate wrappers for all structs in types.h. Although swig does not generate wrappers for those structs, it still warns when a struct doesn't have a name and therefore we need to use this workaround. Signed-off-by: Martin Belanger --- src/nvme/types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nvme/types.h b/src/nvme/types.h index 4dfa35de..3bf22371 100644 --- a/src/nvme/types.h +++ b/src/nvme/types.h @@ -7651,6 +7651,7 @@ enum nvme_io_mgmt_send_mo { NVME_IO_MGMT_SEND_RUH_UPDATE = 0x1, }; +#ifndef SWIG /** * struct nvme_ns_mgmt_host_sw_specified - Namespace management Host Software * Specified Fields. @@ -7734,5 +7735,6 @@ struct nvme_ns_mgmt_host_sw_specified { __le16 phndl[128]; __u8 rsvd768[3328]; }; +#endif /* SWIG */ #endif /* _LIBNVME_TYPES_H */ -- 2.49.0