[Python-Dev] Current CVS version of sysmodule.c fails to compile

Mark Favas m.favas@per.dem.csiro.au
Thu, 11 Jan 2001 17:08:29 +0800


On Tru64 Unix, with Compaq's C/CXX compilers, the current CVS version of
sysmodule.c produces the following errors:

cc -O -Olimit 1500 -I./../Include -I.. -DHAVE_CONFIG_H   -c -o
sysmodule.o sysmodule.c
cc: Error: sysmodule.c, line 73: Invalid declarator. (declarator)
        PyObject *o, *stdout;
----------------------^
cc: Error: sysmodule.c, line 79: In this statement, "o" is not declared.
(undeclared)
        if (!PyArg_ParseTuple(args, "O:displayhook", &o))
------------------------------------------------------^
cc: Error: sysmodule.c, line 93: In this statement, "(&_iob[1])" is not
an lvalue, but occurs in a context that requires one. (needlvalue)
        stdout = PySys_GetObject("stdout");
--------^
cc: Warning: sysmodule.c, line 98: In this statement, the referenced
type of the pointer value "(&_iob[1])" is "struct declared without a
tag", which is not compatible with "struct _object". (ptrmismatch)
        if (PyFile_WriteObject(o, stdout, 0) != 0)
----------------------------------^
cc: Warning: sysmodule.c, line 100: In this statement, the referenced
type of the pointer value "(&_iob[1])" is "struct declared without a
tag", which is not compatible with "struct _object". (ptrmismatch)
        PyFile_SoftSpace(stdout, 1);
-------------------------^

The problem is that stdout is a macro #define'd in stdio.h as (&_iob[1])
(stdin and stderr also are similarly #define'd).

-- 
Mark Favas  -   m.favas@per.dem.csiro.au
CSIRO, Private Bag No 5, Wembley, Western Australia 6913, AUSTRALIA