JSBSim-Team / jsbsim

An open source flight dynamics & control software library
GNU Lesser General Public License v2.1
1.22k stars 420 forks source link

Cython warnings about 'tp_print' which is deprecated #1033

Open bcoconni opened 2 months ago

bcoconni commented 2 months ago

I'm submitting a ...

Describe the issue The compiler issues repeatedly the following warning while compiling JSBSim on MacOSX:

/Users/runner/work/jsbsim/jsbsim/build/python/_jsbsim.cxx:32476:3: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
  0, /*tp_print*/
  ^
/Users/runner/hostedtoolcache/Python/3.8.18/x64/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
    Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
    ^
/Users/runner/hostedtoolcache/Python/3.8.18/x64/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^

What is the current behavior? As stated above.

What is the expected behavior? JSBSim should not use deprecated features.

Please tell us about your environment: MacOSX + Python 3.8

Other information This is a known issue of Cython: https://github.com/cython/cython/issues/3474 which occurs only on MacOSX with Python 3.8

There are a number of options that could be taken to silence this warning including sending a flag to the compiler to ignore deprecation warnings (i.e. something like -Wno-deprecated-declarations). But given that the issue is limited to MacOSX with Python 3.8 and that Python 3.8 will reach its EOL by October this year (see PEP 569), I suggest that we live with these warnings for a few more months. That would save some additional code in setup.py that would need to be removed later.

As such, this issue is created for the record and is tagged "won't fix". It will be closed when JSBSim support of Python 3.8 will end which should be circa October/November 2024.