tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

declaration of strptime



I've had trouble with a couple of packages on amd64 recently because
they use strptime.  The packages worked on i386 but not amd64...  I
noticed when compiling them that the compiler was issuing warnings
about comparing or assigning a pointer and an int.  When I manually
copied the declaration of strptime from /usr/include/time.h, (a) the
compiler shut up, and (b) the program started working.

strptime(3) says to #include <time.h>, which to me at least implies
that doing so will bring in the declaration.  But when I look at time.h
(on -current, if that matters), I see that it's only conditionally
declared:

        /*
         * X/Open Portability Guide >= Issue 4
         */
        #if (_XOPEN_SOURCE - 0) >= 4 || defined(_NETBSD_SOURCE)
        extern int daylight; 

        [[other stuff elided --smb]]

        char *strptime(const char * __restrict, const char * __restrict,
            struct tm * __restrict);
        #endif

I don't know when the conditions are going to be true; clearly, they
were not for my packages.

Two questions...

First -- what should be done in the base system about the declaration
of strptime?  Should it always be declared?  If not, should the man
page be fixed?  (I should probably send-pr this point.)

Second -- what should be in the packages (www/liferea and
mail/claws-mail-rssyl) to cope with this?

                --Steve Bellovin, http://www.cs.columbia.edu/~smb



Home | Main Index | Thread Index | Old Index