Implicit Declaration of function?

Poul-Henning Kamp phk at phk.freebsd.dk
Sun Dec 15 10:45:08 CET 2013


In message <CAChvjRDsTnvdOE6c5Ds+onAG05=wkr4-gBpi01JT3peBYKknzA at mail.gmail.com>
, Jason Price writes:

>warning: implicit declaration of function 'strptime'
>
>I'm trying to do some basic Date parsing in Varnish.  But I get this
>warning on compile.
>
>Here's the relevant bits of VCL:
>
>C{
>#include <time.h>
>#include <sys/time.h>
>#include <stdio.h>
>#include <stdlib.h>
>}C

>I've discovered that if I add:
>
>#define _XOPEN_SOURCE 500
>
>to the first C{ }C block, it passes muster.  Any clue why? (may not be
>varnish related).

No idea, this is related to/caused by the include files on your
operating system possibly in connection with the exact commandline
Varnish uses to compile the code.

(The latter you can see in the parameter "cc_command")

>Varnish related: will that impact anything else inside varnish?

I doubt it, usually that kind of standards-compliance #defines
only affect what is shown in the #includes, it doesn't change
important things like struct layouts etc.


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-misc mailing list