Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#33256 - strptime man page #define is incorrect
Attached to Project:
Arch Linux
Opened by Don Allen (donallen) - Monday, 31 December 2012, 15:25 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Monday, 31 December 2012, 17:37 GMT
Opened by Don Allen (donallen) - Monday, 31 December 2012, 15:25 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Monday, 31 December 2012, 17:37 GMT
|
DetailsDescription:
The strptime man page requires #define _XOPEN_SOURCE. When I do so and compile code that assigns the value of strptime to a char * value, I get a warning from gcc: "assignment makes pointer from integer without a cast" A check of /usr/include/types.h shows two function prototypes for strptime: # ifdef __USE_XOPEN /* Parse S according to FORMAT and store binary time information in TP. The return value is a pointer to the first unparsed character in S. */ extern char *strptime (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp) __THROW; # endif and # ifdef __USE_GNU extern char *strptime_l (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp, __locale_t __loc) __THROW; # endif A full search of time.h for the string _XOPEN_SOURCE finds no matches. When I changed my header file to #define __USE_XOPEN the compilation warning went away. Additional info: * package version(s) * config and/or log files etc. Steps to reproduce: |
This task depends upon
Closed by Gerardo Exequiel Pozzi (djgera)
Monday, 31 December 2012, 17:37 GMT
Reason for closing: Not a bug
Monday, 31 December 2012, 17:37 GMT
Reason for closing: Not a bug
#include <stdlib.h>
#define _XOPEN_SOURCE
#include <time.h>
main()
{
struct tm tm;
char *foo = strptime("abcd", "xyz", &tm);
}
And do
gcc test.c
You will get the error. If you eliminate the #include <stdlib.h>, the error goes away. I have not attempted to diagnose the cause, as these header files are a pretty unbelievable rat's nest.