[Python-Dev] va_list redefinition warning

Skip Montanaro skip@pobox.com
Wed, 2 Jul 2003 15:26:59 -0500


SF is completely down at the moment, otherwise I'd file a bug report.

Building 2.3b2 on a Solaris 8 system using gcc 2.95.3 I see many warnings
about a redefinition of the va_list macro.  Here's one example:

    gcc -c  -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Modules/main.o Modules/main.c
    In file included from Include/stringobject.h:10,
                     from Include/Python.h:83,
                     from Modules/main.c:3:
    /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/include/stdarg.h:170: warning: redefinition of `va_list'
    /usr/include/stdio.h:120: warning: `va_list' previously declared here

Is this a problem which the Python installation can solve or do I just need
to live with the warnings?  The comments in the two header files suggest
that stdio.h is the culprit (sort of).  In /usr/include/stdio.h I see

/*
 * XPG4 requires that va_list be defined in <stdio.h> "as described in
 * <stdarg.h>".  ANSI-C and POSIX require that the namespace of <stdio.h>
 * not be polluted with this name.
 */

In .../stdarg.h I see

/* We deliberately do not define va_list when called from
   stdio.h, because ANSI C says that stdio.h is not supposed to define
   va_list.  stdio.h needs to have access to that data type, 
   but must not use that name.  It should use the name __gnuc_va_list,
   which is safe because it is reserved for the implementation.  */

Skip