_XOPEN_SOURCE in ntpd/refclock_gpsd.c => warnings on BSD
Fred Wright
fw at fwright.net
Thu Aug 22 00:51:19 UTC 2019
On Wed, 21 Aug 2019, Hal Murray via devel wrote:
> ntpd/refclock_gpsd.c has:
> #define _XOPEN_SOURCE 600
>
> I see the following warning:
>
> NetBSD:
> ../../ntpd/refclock_gpsd.c:2118:6: warning: implicit declaration of function
> 'strlcpy' [-Wimplicit-function-declaration]
>
> FreeBSD:
> ../../ntpd/refclock_gpsd.c:2118:6: warning: implicit declaration of function
> 'strlcpy' is invalid in C99 [-Wimplicit-function-declaration]
> strlcpy(pp->a_lastcode, tc, sizeof(pp->a_lastcode));
> ^
> ../../ntpd/refclock_gpsd.c:2118:6: warning: this function declaration is not a
> prototype [-Wstrict-prototypes]
> 2 warnings generated.
>
> I don't understand this area. My tests build without warnings when I comment
> out that line.
>
> I think somebody cleaned up that sort of #define a while ago. Did they forget
> to remove this one?
I see no changes related to _XOPEN_SOURCE since 2017. Perhaps you're
thinking of GPSD, where there was bunch of rework in that area just before
the 3.19 release. Plus a more recent removal of _XOPEN_SOURCE, which
broke FreeBSD, so I put it back for the FreeBSD case.
Fred Wright
More information about the devel
mailing list