diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-05-11 21:40:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-05-11 22:37:53 +0200 |
commit | 893a5249b934f92f072b89b9b558c9de593aa557 (patch) | |
tree | f5b9645a81f195c4a4212e2b83fb2650ced1bd05 /pyuno | |
parent | 184282032856b3120e9f7cf1896c2ebee2d9815d (diff) |
More targeted silencing of -Wdeprecated-declarations
...compared to d1786724b8e8e474e1f7e39012c1f19611841dc0 "prevent warnings in
pyuno with latest python". For one it is only the
/* bpo-37250: kept for backwards compatibility in CPython 3.8 only */
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
member (in /usr/include/python3.8/cpython/object.h) that causes a warning. And
for another it is only Clang that emits a warning when initializing a deprecated
member that way, <http://lists.llvm.org/pipermail/cfe-dev/2020-May/065392.html>
"[cfe-dev] Diagnosing initialization of deprecated data member?"
Change-Id: I36625118a6bb26f5468d436da4caa82911181202
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94016
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'pyuno')
-rw-r--r-- | pyuno/source/module/pyuno.cxx | 14 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_callable.cxx | 14 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_iterator.cxx | 28 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_runtime.cxx | 14 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_struct.cxx | 14 |
5 files changed, 42 insertions, 42 deletions
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx index 1b875b6891d0..ba60f04bbcaa 100644 --- a/pyuno/source/module/pyuno.cxx +++ b/pyuno/source/module/pyuno.cxx @@ -1603,10 +1603,6 @@ static PyMappingMethods PyUNOMappingMethods[] = PyUNO_setitem, /* mp_ass_subscript */ }; -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif static PyTypeObject PyUNOType = { PyVarObject_HEAD_INIT( &PyType_Type, 0 ) @@ -1665,14 +1661,18 @@ static PyTypeObject PyUNOType = #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall #if PY_VERSION_HEX >= 0x03080200 +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif , nullptr //Py_ssize_t tp_print +#if defined __clang__ +#pragma clang diagnostic pop #endif #endif #endif -}; -#ifdef __GNUC__ -#pragma GCC diagnostic pop #endif +}; int PyUNO_initType() { diff --git a/pyuno/source/module/pyuno_callable.cxx b/pyuno/source/module/pyuno_callable.cxx index 548c2bcef7dc..867a7f917aa0 100644 --- a/pyuno/source/module/pyuno_callable.cxx +++ b/pyuno/source/module/pyuno_callable.cxx @@ -178,10 +178,6 @@ static PyObject* PyUNO_callable_call( } -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif static PyTypeObject PyUNO_callable_Type = { PyVarObject_HEAD_INIT( &PyType_Type, 0 ) @@ -240,14 +236,18 @@ static PyTypeObject PyUNO_callable_Type = #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall #if PY_VERSION_HEX >= 0x03080200 +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif , nullptr //Py_ssize_t tp_print +#if defined __clang__ +#pragma clang diagnostic pop #endif #endif #endif -}; -#ifdef __GNUC__ -#pragma GCC diagnostic pop #endif +}; PyRef PyUNO_callable_new ( const Reference<XInvocation2> &my_inv, diff --git a/pyuno/source/module/pyuno_iterator.cxx b/pyuno/source/module/pyuno_iterator.cxx index 9258b780a304..8337feba9a9d 100644 --- a/pyuno/source/module/pyuno_iterator.cxx +++ b/pyuno/source/module/pyuno_iterator.cxx @@ -110,10 +110,6 @@ static PyObject* PyUNO_iterator_next( PyObject *self ) return nullptr; } -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif static PyTypeObject PyUNO_iterator_Type = { PyVarObject_HEAD_INIT( &PyType_Type, 0 ) @@ -172,14 +168,18 @@ static PyTypeObject PyUNO_iterator_Type = #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall #if PY_VERSION_HEX >= 0x03080200 +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif , nullptr //Py_ssize_t tp_print +#if defined __clang__ +#pragma clang diagnostic pop #endif #endif #endif -}; -#ifdef __GNUC__ -#pragma GCC diagnostic pop #endif +}; PyObject* PyUNO_iterator_new( const Reference< XEnumeration >& xEnumeration ) { @@ -256,10 +256,6 @@ static PyObject* PyUNO_list_iterator_next( PyObject *self ) return nullptr; } -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif static PyTypeObject PyUNO_list_iterator_Type = { PyVarObject_HEAD_INIT( &PyType_Type, 0 ) @@ -318,14 +314,18 @@ static PyTypeObject PyUNO_list_iterator_Type = #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall #if PY_VERSION_HEX >= 0x03080200 +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif , nullptr //Py_ssize_t tp_print +#if defined __clang__ +#pragma clang diagnostic pop #endif #endif #endif -}; -#ifdef __GNUC__ -#pragma GCC diagnostic pop #endif +}; PyObject* PyUNO_list_iterator_new( const Reference<XIndexAccess> &xIndexAccess ) { diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index a082907a1fac..790395bf9a60 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -70,10 +70,6 @@ using com::sun::star::beans::theIntrospection; namespace pyuno { -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif static PyTypeObject RuntimeImpl_Type = { PyVarObject_HEAD_INIT (&PyType_Type, 0) @@ -132,14 +128,18 @@ static PyTypeObject RuntimeImpl_Type = #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall #if PY_VERSION_HEX >= 0x03080200 +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif , nullptr //Py_ssize_t tp_print +#if defined __clang__ +#pragma clang diagnostic pop #endif #endif #endif -}; -#ifdef __GNUC__ -#pragma GCC diagnostic pop #endif +}; /*---------------------------------------------------------------------- Runtime implementation diff --git a/pyuno/source/module/pyuno_struct.cxx b/pyuno/source/module/pyuno_struct.cxx index 27b24b1659ec..7696a231f24a 100644 --- a/pyuno/source/module/pyuno_struct.cxx +++ b/pyuno/source/module/pyuno_struct.cxx @@ -290,10 +290,6 @@ static PyMethodDef PyUNOStructMethods[] = {nullptr, nullptr, 0, nullptr} }; -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif static PyTypeObject PyUNOStructType = { PyVarObject_HEAD_INIT( &PyType_Type, 0 ) @@ -352,14 +348,18 @@ static PyTypeObject PyUNOStructType = #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall #if PY_VERSION_HEX >= 0x03080200 +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif , nullptr //Py_ssize_t tp_print +#if defined __clang__ +#pragma clang diagnostic pop #endif #endif #endif -}; -#ifdef __GNUC__ -#pragma GCC diagnostic pop #endif +}; int PyUNOStruct_initType() { |