[Python-Dev] cvs socketmodule.c and IPV6 disabled (original) (raw)

Chris Johns cjohns@cybertec.com.au
Tue, 29 Apr 2003 07:54:32 +1000


Martin v. L=F6wis wrote:

Chris Johns <cjohns@cybertec.com.au> writes: =20 =20

Porting Python to the open source realtime OS called RTEMS I get a compile error on line 2797 of socketmodule.c.=20 =20 =20 In my copy, this is the line =20 char packed[MAX(sizeof(struct inaddr), sizeof(struct in6addr))]; ^^ I would assume the marked code is for IPV6 so needs to be protected by=20 ENABLE_IPV6, for example:

#ifdef ENABLE_IPV6 char packed[MAX(sizeof(struct in_addr), sizeof(struct in6_addr))]; #else char packed[sizeof(struct in_addr)]; #endif

=20 Can you report more on the nature of the compile error (such as its message)? =20

(I do not use the Python build system as I have to cross-compile and so u= se an=20 automake makefile in a RISCOS type layout)

Sure. The output is from gcc-3.2.3:

m68k-rtems-gcc -DHAVE_CONFIG_H -I. -I../python-cvs/dist/src/RTEMS -I.=20 -I../python-cvs/dist/src/RTEMS/../Include=20 -I../python-cvs/dist/src/RTEMS/../Python -I/opt/rtems/m68k-rtems/lib/incl= ude=20 -m5200 -O4 -g -DPLATFORM=3D""RTEMS (m5200)"" -c -o socketmodule.o tes= t -f=20 '../python-cvs/dist/src/RTEMS/../Modules/socketmodule.c' || echo=20 '../python-cvs/dist/src/RTEMS/'../python-cvs/dist/src/RTEMS/../Modules/s= ocketmodule.c =2E./python-cvs/dist/src/Modules/socketmodule.c: In function socket_inet= _pton': =2E./python-cvs/dist/src/Modules/socketmodule.c:2797: sizeof applied to a= n=20 incomplete type =2E./python-cvs/dist/src/Modules/socketmodule.c:2797: sizeof applied to a= n=20 incomplete type =2E./python-cvs/dist/src/Modules/socketmodule.c:2816: sizeof applied to a= n=20 incomplete type =2E./python-cvs/dist/src/Modules/socketmodule.c: In function socket_inet= _ntop': =2E./python-cvs/dist/src/Modules/socketmodule.c:2835: INET_ADDRSTRLEN' u= ndeclared=20 (first use in this function) =2E./python-cvs/dist/src/Modules/socketmodule.c:2835: (Each undeclared id= entifier=20 is reported only once =2E./python-cvs/dist/src/Modules/socketmodule.c:2835: for each function i= t appears=20 in.) =2E./python-cvs/dist/src/Modules/socketmodule.c:2835: INET6_ADDRSTRLEN' =

undeclared (first use in this function) =2E./python-cvs/dist/src/Modules/socketmodule.c:2851: sizeof applied to a= n=20 incomplete type

=20

Should this code check ENABLEIPV6 as IPV6 is not support on RTEMS yet.=

=20 =20 (assuming this is a question): I'm unsure. It should not cause a compile time failure, period. =20

Sorry, it was a question. See above.

=20

Also where is INETADDRSTRLEN suppose to be defined ? =20 <netinet/in.h> =20

Thanks. The RTEMS TCP/IP stack is an old port of the FreeBSD stack and do= es not=20 have this. The current FreeBSD does so I will fix RTEMS. I will not add=20 INET6_ADDRSTRLEN as no other IPV6 support is currently provided.

--=20 Chris Johns, cjohns at cybertec.com.au