[Patches] [Patch #101342] remove -Wstrict-prototypes warnings [aka: Anal Crusade I]
Thomas Wouters
thomas@xs4all.net
Tue, 29 Aug 2000 16:24:50 +0200
On Tue, Aug 29, 2000 at 04:59:35AM -0700, noreply@sourceforge.net wrote:
> Summary: remove -Wstrict-prototypes warnings [aka: Anal Crusade I]
> By: nowonder
> Comment:
> there is one remaining warning in Modules/main.c. The comment says that
> getopt() has no standardized prototype. The one given (int, char **, char
> *) does not work on Linux, but (int, char *const *, const char *) does. Is
> it worth doing some autoconf magic, or should we just let the warning
> stick where it is?
Do yourself (and the rest of us) a favor, and move the 'getopt' prototype
into pyport.h and comment it out, re-adding it only for those platforms that
don't have a getopt prototype.
The problem is that a 'char * const *' (or was it a const char ** ?) and a
'char **' are two *incompatible* types, according to the ANSI C std. It
won't matter when you call the function, but it does when you provide a
conflicting prototype yourself. There simply is no prototype that will work
everywhere.
--
Thomas Wouters <thomas@xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!