Dear all,
I noticed new warnings when compiling a cython project with recent
version of python (3.12) and cython (3+).
https://github.com/silx-kit/pyFAI/issues/2136
The warning is about constructors & destructors of C++ classes which cannot be "noexcept" because they return Python objects...
The code is not from me and I am neither a guru of C++, so maybe one
of you can help me to understand the meaning of this warning ?
Here is a snippet of code with such class: the constructor & destructor
are raising a warning but not the `push` method. As you probably
recognized, this is used as a GIL-free container with resizable storage.
```
cdef cppclass PixelBin:
clist[pixel_t] _pixels
PixelBlock *_pixels_in_block
PixelBin(int block_size, Heap *heap) noexcept nogil:
if block_size > 0:
this._pixels_in_block = new PixelBlock(block_size, heap)
else:
this._pixels_in_block = NULL
__dealloc__() noexcept nogil:
if this._pixels_in_block != NULL:
del this._pixels_in_block
this._pixels_in_block = NULL
else:
this._pixels.clear()
void push(pixel_t &pixel) noexcept nogil:
if this._pixels_in_block != NULL:
this._pixels_in_block.push(pixel)
else:
this._pixels.push_back(pixel)
```
Thanks for your help
--
Jérôme Kieffer