From: Martin Belanger Date: Thu, 27 Apr 2023 14:13:19 +0000 (-0400) Subject: python/swig: Wrap swig-sensitive struct inside #ifwdef SWIG X-Git-Tag: v1.5~34 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1b04a3832663cd0e790638646d78c0ee1a83098a;p=users%2Fsagi%2Flibnvme.git 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 --- 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 */