[Python-Dev] 2.3.3 Compilation warnings...

Guido van Rossum guido at python.org
Sat Dec 27 17:39:47 EST 2003

> I don't know what the policy on compilation warnings are with the
> development of Python, but I'd imagine that it's "no warnings".

Right, if possible.

> I get the following warnings:
> gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -
> I. -I./Include  -DPy_BUILD_CORE -o Python/errors.o Python/errors.c
> Python/errors.c:602: warning: function declaration isn't a prototype
> gcc -pthread  -Xlinker -export-dynamic -o python \
>                 Modules/python.o \
>                 libpython2.3.a -lpthread -ldl  -lutil   -lm
> libpython2.3.a(posixmodule.o): In function `posix_tmpnam':
> /usr/local/src/Python-2.3.3/./Modules/posixmodule.c:5833: the use of `tmpnam_r'
> is dangerous, better use `mkstemp'
> libpython2.3.a(posixmodule.o): In function `posix_tempnam':
> /usr/local/src/Python-2.3.3/./Modules/posixmodule.c:5788: the use of `tempnam'
> is dangerous, better use `mkstemp'

Note that this is the linker speaking, not the compiler.  The only way
to get rid of this warning is not to use those two entry points, which
means removing the functions os.tempnam() and os.tmpnam().  That will
eventually happy.  These functions have been deprecated already, but
for backwards compatibility, we need to provide them for a few more
releases.  In the mean time, I don't know how to tell the linker to
suppress the warnings.

> building 'readline' extension
> gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -fno-strict-aliasin
> g -I. -I/usr/local/src/Python-2.3.3/./Include -I/usr/local/include -I/usr/local/
> src/Python-2.3.3/Include -I/usr/local/src/Python-2.3.3 -c
> /usr/local/src/Python-2.3.3/Modules/readline.c -o
> build/temp.linux-i686-2.3/readline.o
> /usr/local/src/Python-2.3.3/Modules/readline.c: In function `flex_complete':
> /usr/local/src/Python-2.3.3/Modules/readline.c:583: warning: implicit
> declaration of function `completion_matches'
> /usr/local/src/Python-2.3.3/Modules/readline.c:583: warning: return makes
> pointer from integer without a cast

This seems a case of a missing function declaration in readline.h.
Unfortunately being compatible with all versions of GNU readline that
are around is very tricky.  If you have a patch, I'd consider it, but
it would have to be tested on a number of different platforms before
being accepted.  I don't have the time to do all the verification

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list