* [PATCH] strptime.3: add #define to example to avoid implicit declaration of strptime
@ 2008-01-06 3:04 Carlo Marcelo Arenas Belon
2008-01-06 10:11 ` Michael Kerrisk
0 siblings, 1 reply; 2+ messages in thread
From: Carlo Marcelo Arenas Belon @ 2008-01-06 3:04 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
The example doesn't follow the guidelines given in the description and will
result in the following warning if compiled :
In function 'main':
13: warning: implicit declaration of function 'strptime'
Carlo
---
diff -urp man-pages-2.74/man3/strptime.3 man-pages-2.74/man3/strptime.3
--- man-pages-2.74/man3/strptime.3 2007-12-20 04:13:45.000000000 -0800
+++ man-pages-2.74/man3/strptime.3 2008-01-05 18:46:04.000000000 -0800
@@ -384,6 +384,7 @@ and
.BR strftime (3).
.sp
.nf
+#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
-
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] strptime.3: add #define to example to avoid implicit declaration of strptime
2008-01-06 3:04 [PATCH] strptime.3: add #define to example to avoid implicit declaration of strptime Carlo Marcelo Arenas Belon
@ 2008-01-06 10:11 ` Michael Kerrisk
0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk @ 2008-01-06 10:11 UTC (permalink / raw)
To: Carlo Marcelo Arenas Belon
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
linux-man-u79uwXL29TY76Z2rM5mHXA
On Jan 6, 2008 4:04 AM, Carlo Marcelo Arenas Belon
<carenas-kLeDWSohozoJb6fo7hG9ng@public.gmane.org> wrote:
> The example doesn't follow the guidelines given in the description and will
> result in the following warning if compiled :
>
> In function 'main':
> 13: warning: implicit declaration of function 'strptime'
Hi Carlo,
Thanks for your report. _GNU_SOURCE will do the job, but as documented
in the man page, _XOPEN_SOURCE is the precise macro required. So I
added that to the example program. The change will be in
man-pages-2.76.
Cheers,
Michael
> ---
> diff -urp man-pages-2.74/man3/strptime.3 man-pages-2.74/man3/strptime.3
> --- man-pages-2.74/man3/strptime.3 2007-12-20 04:13:45.000000000 -0800
> +++ man-pages-2.74/man3/strptime.3 2008-01-05 18:46:04.000000000 -0800
> @@ -384,6 +384,7 @@ and
> .BR strftime (3).
> .sp
> .nf
> +#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <time.h>
>
--
Michael Kerrisk
Maintainer of the Linux man-pages project
http://www.kernel.org/doc/man-pages/
Want to report a man-pages bug? Look here:
http://www.kernel.org/doc/man-pages/reporting_bugs.html
-
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-06 10:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-06 3:04 [PATCH] strptime.3: add #define to example to avoid implicit declaration of strptime Carlo Marcelo Arenas Belon
2008-01-06 10:11 ` Michael Kerrisk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox