[Cython] couple gcc warnings problems
Dag Sverre Seljebotn
dagss at student.matnat.uio.no
Mon Aug 4 20:01:51 CEST 2008
Lisandro Dalcin wrote:
> Look what SWIG does:
> /* attribute recognised by some compilers to avoid 'unused' warnings */
> #ifndef SWIGUNUSED
> # if defined(__GNUC__)
> # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 &&
> __GNUC_MINOR__ >= 4))
> # define SWIGUNUSED __attribute__ ((__unused__))
> # else
> # define SWIGUNUSED
> # endif
> # elif defined(__ICC)
> # define SWIGUNUSED __attribute__ ((__unused__))
> # else
> # define SWIGUNUSED
> # endif
> #endif
>
> #ifndef SWIGUNUSEDPARM
> # ifdef __cplusplus
> # define SWIGUNUSEDPARM(p)
> # else
> # define SWIGUNUSEDPARM(p) p SWIGUNUSED
> # endif
> #endif
>
> Then, this approach can be used for unused arguments as well as unused
> functions. Currently, I'm getting warnings about PyObject_GetBuffer()
> and PyObject_ReleaseBuffer() being defined and not used (though
> perhaps this should be handled using the 'utilitity_code' way)
Are you using the latest cython-devel? This should have been fixed now.
(The other one is a real problem which I will fix, thanks for the test
case and report.)
--
Dag Sverre
More information about the Cython-dev
mailing list