✘integer overflow in expression

Gary E. Miller gem at rellim.com
Thu Sep 29 06:26:27 UTC 2016


Yo Eric!

On Wed, 28 Sep 2016 23:58:39 -0400
"Eric S. Raymond" <esr at thyrsus.com> wrote:

> Gary E. Miller <gem at rellim.com>:
> > Yo All!
> > 
> > I'm getting a new warning on the build:
> > 
> > [153/250] Compiling util/sht.c
> > ../../util/hist.c: In function ‘main’:
> > ../../util/hist.c:22:20: warning: integer overflow in expression
> > [-Woverflow] #define NCNT (600L * NANOSECONDS) /* sample interval
> > (ns) */ ^
> > ../../util/hist.c:57:15: note: in expansion of macro ‘NCNT’
> >    if (u - v > NCNT)
> >                ^
> > 
> > I'm guessing this commit: d9024785b6c5a8b648b4f6a6982b6de1d2afa286  
> 
> Yeah, I got that warning and fixed it by giving the NANOSECONDS value
> an 'L' suffix so the expression is long-valued. Are you building on a
> 32-bit machine?

Nope.  64 bit Gentoo stable and unstable. gcc 5.4.0 and 4.9.3

> The series of changes that produced this was, by the way, intended to
> do two worthwhile things:

The road to hell is paved with good intentions...

> Note that this series did not actually change what ntpd does on
> POSIX-conformant systems. ntpd was using clock_gettime and
> clock_settime before and still does that now; the change away from
> settimeofday only affected auxiliary programs.

I make no claim as to why things changed, but change they did.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ntpsec.org/pipermail/devel/attachments/20160928/c9f38ffe/attachment.bin>


More information about the devel mailing list