Re: ✘Warnings on OSX

Fred Wright fw at fwright.net
Sat Aug 31 03:31:46 UTC 2019


On Fri, 30 Aug 2019, Fred Wright via devel wrote:
> On Thu, 29 Aug 2019, Gary E. Miller via devel wrote:
>
>>  Warnings on OSX:
>>
>>  [ 73/131] Compiling libntp/ntp_calendar.c
>>  ../../ntpd/ntp_control.c:2612:27: warning: format specifies type 'unsigned
>>  short' but the argument has type 'unsigned int' [-Wformat]
>>                             socktoa(rmt_addr),
>>                             (unsigned)SRCPORT(rmt_addr));
>>                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>>  1 warning generated.
>> 
>>
>>  [106/131] Compiling ntpd/ntp_dns.c
>>  ../../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.
>>
>>  Anyone want to fix them?
>
> The second one, which was present on FreeBSD as well, seems to have been 
> caused by the definition of _XOPEN_SOURCE in refclock_gpsd.c.  And in spite 
> of what the comment says, this definition does *not* seem to be needed to get 
> strptime().  So simply removing it gets rid of the warning, and doesn't break 
> anything AFAICT.
>
> I'm looking at the other one now.

The other one was just the obvious fix.  So obvious that it required 
closer examination to make sure I wasn't missing something. :-)

MR submitted.  I don't think this is release-critical, though both chnages 
should be fairly low-risk since one is only in refclock_gpsd and the other 
is only in a logging message call.

Fred Wright


More information about the devel mailing list