warnings: 'NANOSECOND' macro redefined

Hal Murray hmurray at megapathdsl.net
Wed Mar 15 03:28:40 UTC 2017


../../include/timespecops.h:65:9: warning: 'NANOSECOND' macro redefined 
[-Wmacro-redefined]

NetBSD:
/usr/include/sys/timex.h:#define NANOSECOND     1000000000L /* nanoseconds in 
one second */

FreeBSD:
/usr/include/sys/timex.h:#define NANOSECOND     1000000000L /* nanoseconds in 
one second */

I didn't investigate any version details.  I don't think it has changed 
recently.

-------

I'm pretty sure I've seen some ifdef dancing around this problem, but I can't 
find it now.

This area could use some cleanup.  Aside from the defines in timespecops.h, 
grep finds these:

./ntpd/ntp_loopfilter.c:# define NANOSECONDS    1e9
./ntpd/ntp_loopfilter.c:#define MICROSECONDS    1e6
./ntpd/ntp_control.c:#define MILLISECONDS       1000    /* milliseconds per 
second -magic numbers suck */
./ntpfrob/bumpclock.c:#define NANOSECONDS       1000000000


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list