Re: ✘integer overflow in expression

2016-09-29 Thread Eric S. Raymond
Daniel Franke : > This whole module is a big mess of undefined behavior. You're right. I've just deleted it, quoting you on the problems in the change comment. Similar ones were present in the gettimeofday() version because the thing was a relic from before the 64-bit transition. If we need a b

Re: ✘integer overflow in expression

2016-09-29 Thread Daniel Franke
This whole module is a big mess of undefined behavior. If you're going to store time as a count of nanoseconds, then of course you're going to overflow a 32-bit integer quickly. 'long' is 32 bits on most 32-bit ABIs. You want all your working variables to be int64_t. The correct way to express an

Re: ✘integer overflow in expression

2016-09-28 Thread Gary E. Miller
Yo Eric! On Wed, 28 Sep 2016 23:58:39 -0400 "Eric S. Raymond" wrote: > > 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-bi

Re: ✘integer overflow in expression

2016-09-28 Thread Gary E. Miller
Yo Eric! On Wed, 28 Sep 2016 23:58:39 -0400 "Eric S. Raymond" wrote: > Gary E. Miller : > > Yo All! > > > > I'm getting a new warning on the build: > > > > [153/250] Compiling util/sht.c > > ../../util/hist.c: In function ‘main’: >

Re: ✘integer overflow in expression

2016-09-28 Thread Eric S. Raymond
Gary E. Miller : > 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 * NANOSE

✘integer overflow in expression

2016-09-28 Thread Gary E. Miller
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) */ ^ ../..