[ntp:hackers] Recent C99-isms

Danny Mayer mayer at ntp.org
Sun Jan 4 16:33:28 UTC 2015


On 1/4/2015 3:58 AM, Harlan Stenn wrote:
> "David J Taylor" writes:
>> I had to re-open bug 2695 as it doesn't build in VS2013 either.
>>
>>   http://bugs.ntp.org/show_bug.cgi?id=2695#c7
>>
>> New bugs:
>>
>> 'T_Mdnstries' : undeclared identifier   (keyword-gen.c)
> 
> That's a problem where I apparently didn't check in some updated files,
> and the "bootstrap" process makes sure the file timestamps are such that
> these updated files will not be rebuilt.  I'll regenerate these files soon.
> 
>> '__func__' : undeclared identifier  (jupiter.c)
> 
> This one is strange - we are using __func__ in a number of other places
> now too, like ntp_loopfilter.c and ntpd.c.  It's also used heavily in
> libevent, which is used by sntp (which is not yet built on Windows).
> 
>> Cannot open include file: 'sys/socket.h' (in refclock_nmea.c )
> 
> That's an addition from the NetBSD folks.  I'm not sure why they did
> that.
> 
> We sould enclose that in #ifdef HAVE_SYS_SOCKET_H/#endif, as we do
> elsewhere.
> 
> I'll push out a beta4 now with this change in it.

Harlan and I discussed some of this last night. VS2008 does not support
the partial initialization in C99 standards and causes errors. The
refclocks seem to be all compiled in and I'm sure most people don't run
refclocks on Windows. If there's a need then maybe having a build with
refclocks and one without would be beneficial. The sys/socket.h issue
should never have been included there and I don't think that sockets are
called in that code anyway. Sockets need to be define elsewhere in the
include heirarchy.

If David is getting this to build (apart from the above error) on vs2013
then it may support partial initializations. I will try to get VS2010
installed tonight (it takes a long time to install) and see what it does.

Danny


More information about the hackers mailing list