[ntp:questions] Garmin LVC 18x jitter problem

Terje Mathisen terje.mathisen at tmsw.no
Tue Aug 13 10:33:39 UTC 2019

Jakob Bohm wrote:
> On 11/08/2019 14:03, Michael Haardt wrote:
>> Jakob Bohm <jb-usenet at wisemo.com.invalid> writes:
>>> Minor issue 1: You seem not to initialize fudgeminjitter if not
>>> configured.  Probably to 0.0
>> All values are initialized to 0 when the structs are allocated, I
>> checked that.  That's why it works without a flag bit at all.  I
>> still like the flag bits more, because they make everything easier
>> to understand.
> If this is done by setting all bytes of the memory to 0, this doesn't
> necessarily map to 0.0 in the floating point formats of all machines.

Not necessarily so (it is in fact legal for a C compiler to have NULL 
pointers that are non-zero and/or a floating point format with the same 
quirk), but in reality, always true:

Afaik, every single target of the ntpd reference code (basically windows 
plus a _large_ bunch of unix-like OSs) are currently running on "sane" 
CPUs, i.e. with two's complement binary integers and IEEE 754 FP.

Even on my "hobby" architecture (Mill), where pointers are separate from 
integers, all FP values are still using 754 formats at all times.
> If the ntp code does something more clever (like knowing that a certain
> address range is an array of doubles), it might still work if you make
> sure the assumptions of that clever code still holds.

No cleverness required.


- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

More information about the questions mailing list