warnings: 'NANOSECOND' macro redefined

Gary E. Miller gem at rellim.com
Wed Mar 15 03:37:45 UTC 2017


Yo Hal!

On Tue, 14 Mar 2017 20:28:40 -0700
Hal Murray <hmurray at megapathdsl.net> wrote:

> ../../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.

Good catch.

That will be ugly since I defined NANOSECOND as 1e-9.  Their
definition is actually nano seconds per second.  Another misleading
choice by BSD.

NTPsec defines 1e-9 as NANOSECONDS.

So, any preferences for different and dsescription names that
do not conflict with the misleading *BSD names?


> 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

So?  They are all unique, all have their special place.

If you did a context grep the comments would expalin a bit more.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20170314/0f8603c8/attachment.bin>


More information about the devel mailing list