From da4a2e4ea4c98f1a78f55abfae0ed7be07182dca Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 15 Oct 2020 17:07:39 +0200 Subject: [PATCH] Py3: suppress warning: 'tp_print' is deprecated [-Wdeprecated-declarations] If the tp_print slot is not set the warning -Wmissing-field-initializers is raised. If it's set then -Wdeprecated-declarations is raised. So, the only way is to suppress it. --- src/Tools/generateTemplates/templateClassPyExport.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Tools/generateTemplates/templateClassPyExport.py b/src/Tools/generateTemplates/templateClassPyExport.py index bceef0d7be..bc7f60749a 100644 --- a/src/Tools/generateTemplates/templateClassPyExport.py +++ b/src/Tools/generateTemplates/templateClassPyExport.py @@ -279,6 +279,11 @@ public: #include #include +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + using Base::streq; using namespace @self.export.Namespace@; @@ -892,6 +897,10 @@ int @self.export.Name@::_setattr(const char *attr, PyObject *value) // __setattr return static_cast<@self.export.TwinPointer@ *>(_pcTwinPointer); } +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + #if 0 /* From here on come the methods you have to implement, but NOT in this module. Implement in @self.export.Name@Imp.cpp! This prototypes * are just for convenience when you add a new method.