[Numpy-discussion] Warnings in current trunk

David Cournapeau david at ar.media.kyoto-u.ac.jp
Tue Feb 17 22:56:59 EST 2009


Charles R Harris wrote:
> I see a lot of warnings like:
>
> In file included from numpy/core/src/multiarraymodule.c:87:
> numpy/core/src/umath_funcs_c99.inc.src:199:1: warning: "isnan" redefined
> In file included from /usr/include/python2.5/pyport.h:204,
>                  from /usr/include/python2.5/Python.h:57,
>                  from numpy/core/src/multiarraymodule.c:18:
>
> These are probably from r6363.
>
> Also
>
> In file included from numpy/core/src/scalartypes.inc.src:10,
>                  from numpy/core/src/arrayobject.c:537,
>                  from numpy/core/src/multiarraymodule.c:102:
> numpy/core/src/numpyos.c: In function 'NumPyOS_ascii_strtod':
> numpy/core/src/numpyos.c:431: warning: assignment discards qualifiers
> from pointer target type
> numpy/core/src/numpyos.c:480: warning: assignment discards qualifiers
> from pointer target type

The second one should be easy to fix, the first one not so much. The
problem is simple: for the float format fixes recently merged in the
trunk, we need some math functions - those format functions are used in
multiarray extension. Up to now, we only needed math function in ufunc,
and did so by including .c files. I first did the obvious thing,
including the same file as well in multiarray, but it does not work so
well, as you can see.

I think this "including .c" business has got to a point where it is
becoming insane :) Not only does it make the code difficult to follow
(at least to me), but it also causes various issues on MS platforms,
which are difficult to track (VS definitely does not like big files, and
often segfaults). Of course, for python API, we don't have a choice
because of C limitations (if we care about cross platform that is), but
we can make things better.

My recent question about a core math library comes exactly from this. Of
course, I then discovered that some distutils limitations makes
compiling this core math library more difficult than expected (because
the config.h generation cannot be done as it is for a library, only for
an extension).

cheers,

David



More information about the NumPy-Discussion mailing list