[Python-Dev] ANSIfication.

Guido van Rossum guido@beopen.com
Tue, 25 Jul 2000 07:38:19 -0500

> I'm done checking in the ansification patches. It doesn't fix everything,
> for a couple of reasons:

Thanks for doing all this work, Thomas!

Frankly, I think that for *any* functions that are in some external
library (e.g. libc), Python should never provide a function prototype
at all.  The standard headers should provide the prototypes!

There used to be a bunch of systems out there where the standard
headers were inadequate for one reason or another -- e.g. some systems
didn't bother to declare int functions, and Python was taking pointers
to such functions.  But this should all long be gone...  I don't mind
breaking some ports in a minor way by removing *all* prototypes for
standard library functions.  (Ditto for non-standard external
libraries like readline.)

I recall that more recently there were also some cases where a
prototype wasn't in scope because the right combination of magical
#defines wasn't present, especially for functions that weren't in the
old POSIX or C standards.  Adding prototypes for these is wrong: we
should figure out the right #defines and define these in Python.h or

> There are a couple of more things that might be candidate for cleanup or
> removal now, by the way. The 'ANY' #define in Include/mymalloc.h, and the
> type(s) derived from it, for instance. I'm not sure how 'standard' the void*
> type is, but I thought it was ANSI mandated ?

Yes, void* is ANSI.  Get rid of all references to ANY.  (Ages ago,
on K&R systems ANY had to defined as char *.)

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