[GRASS-dev] GRASS 7 swig compile warnings and errors

Markus Neteler neteler at osgeo.org
Sun Jan 18 01:33:21 EST 2009


Hi,

I get warnings and errors in swig/python/:

cd swig/python/
make
...
gcc -I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include  -g
-Wall  -fno-common -mtune=nocona -m64 -minline-all-stringops   -fPIC
-I/usr/include/python2.5 -I/usr/include/python2.5
-DPACKAGE=\""grasslibs"\"
-I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include -o
OBJ.x86_64-unknown-linux-gnu/utils_wrap.o -c utils_wrap.c
utils_wrap.c: In function 'pyseq_to_ptr':
utils_wrap.c:2564: warning: format '%d' expects type 'int', but
argument 3 has type 'Py_ssize_t'
...
/usr/bin/swig -I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include
-python -module date -shadow date.i
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/datetime.h:18:
Warning(314): 'from' is a python keyword, renaming to '_from'

gcc -I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include  -g
-Wall  -fno-common -mtune=nocona -m64 -minline-all-stringops   -fPIC
-I/usr/include/python2.5 -I/usr/include/python2.5
-DPACKAGE=\""grasslibs"\"
-I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include -o
OBJ.x86_64-unknown-linux-gnu/date_wrap.o -c date_wrap.c
date_wrap.c: In function 'pyseq_to_ptr':
date_wrap.c:2563: warning: format '%d' expects type 'int', but
argument 3 has type 'Py_ssize_t'
...
/usr/bin/swig -I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include
-python -module grass -shadow grass.i
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:39:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:587:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:591:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:593:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:594:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:595:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:596:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:604:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:607:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:608:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:617:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:618:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:619:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:625:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:626:
Warning(451): Setting a const char * variable may leak memory.
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/gis.h:627:
Warning(451): Setting a const char * variable may leak memory.
gcc -I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include  -g
-Wall  -fno-common -mtune=nocona -m64 -minline-all-stringops   -fPIC
-I/usr/include/python2.5 -I/usr/include/python2.5
-DPACKAGE=\""grasslibs"\"
-I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include -o
OBJ.x86_64-unknown-linux-gnu/grass_wrap.o -c grass_wrap.c
grass_wrap.c: In function 'pyseq_to_ptr':
grass_wrap.c:2620: warning: format '%d' expects type 'int', but
argument 3 has type 'Py_ssize_t'
grass_wrap.c: In function '_wrap_G_vasprintf':
grass_wrap.c:18166: error: incompatible types in assignment
make[1]: *** [OBJ.x86_64-unknown-linux-gnu/grass_wrap.o] Error 1
make[1]: Leaving directory `/home/neteler/grass70/swig/python'
make: *** [default] Error 2


Looking around grass_wrap.c:2620

static void *pyseq_to_ptr(PyObject *input, int data_type)
{
        size_t size;
        Py_ssize_t len;
...
        len = PySequence_Length(input);
        array = malloc(len * size);

        fprintf(stderr, "sequence length is %d\n", len);
...

swig -version
SWIG Version 1.3.36

Linux mandrivalinux.local 2.6.27.7-server-1mnb #1 SMP Thu Dec 11
17:41:52 EST 2008 x86_64Intel(R) Core(TM)2 CPU         T5500  @
1.66GHz GNU/Linux

cat /etc/issue
Mandriva Linux release 2009.0 (Official) for x86_64
Kernel 2.6.27.7-server-1mnb on a Dual-processor x86_64 / \l

Python 2.5.2 (r252:60911, Jan  8 2009, 13:05:10)

I have no idea how to fix this.

Markus


More information about the grass-dev mailing list