[Patches] Fix compiler warning on Linux

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Tue, 30 May 2000 00:19:05 +0200


Greg Ward wrote:
> On Linux (glibc 2.0, at least), compiling the current timemodule.c
> causes a compiler warning since the prototype for strptime() is not =
seen:
>=20
>   gcc  -g -O2 -I./../Include -I.. -DHAVE_CONFIG_H -c ./timemodule.c
>   ./timemodule.c: In function `time_strptime':
>   ./timemodule.c:442: warning: assignment makes pointer from integer =
without a cast
>=20
> This patch fixes that.  Anyone see a problem with this, or shall I =
check
> it in?  Should the "#define __USE_XOPEN" be wrapped in glibc-detecting
> code?

umm.  according to my copy of features.h, __USE_XOPEN is an
*internal* GNU-specific thingie.  any reason you cannot do this
in a portable way, and use

    #define _XOPEN_SOURCE

instead, just as the unix specifications say?

(see GNU's features.h for a discussion of environment defines)

</F>