[Python-Dev] ANSIfication.

Thomas Wouters thomas@xs4all.net
Wed, 26 Jul 2000 22:50:32 +0200

On Wed, Jul 26, 2000 at 03:30:01PM +0200, Jack Jansen wrote:

> > 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!

> They should, but what if they don't? That's what I like about the
> pyport.h: it allows Python to build out of the box but still keeps all the
> cruft needed because some platforms don't have their act together in a
> single place. I know that I'm not expected to understand sections of
> pyport.h that are for platforms I'm not familiar with...

That's kind-of what I wrote in my reply to Guido. There is only one problem
with this, though, and that's finding platform-identifying #defines. I don't
have enough experience with portable software to assume anything, and I
unable to find anything identifying the platform on the one Solaris 2.6 box
we have (and don't use, because it's Solaris ;) I haven't tried finding any
on the Linux or BSDI boxes we do use, but I think Linux glibc2 is
recognizable -- but that's also the system most likely to be up to date !

If anyone can give some hints on identifying platforms, or finding out
whether a given prototype is included in the header files, please do :P
Until then, I don't think we can do much else with the *current* prototypes
than remove them. And if anyone needs those #defines, they'll have to figure
out how to uniquely identify their architecture, first.

Actually... I think it's possible for autoconf to find out if a prototype
is included by trying to take the address of a function... but that's kind
of a severe method, and doesn't say anything about what the prototype should
look like.

And is there really any danger of real bugs being caused by missing
prototypes ? Most (well, at least *some*) testing is done on Linux systems,
on which I have yet to find a prototype missing from the std. include files.
It'll generate some warnings on some other operating systems, but that's
all, I think.

Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!