_XOPEN_SOURCE in ntpd/refclock_gpsd.c => warnings on BSD

Hal Murray hmurray at megapathdsl.net
Wed Aug 21 22:41:18 UTC 2019


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?

----------

./libparse/clk_sel240x.c also references _XOPEN_SOURCE
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE        600
#endif

My tests also build without that.


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list