New config feature - time1 can declare GPS wraparound compensation

Eric S. Raymond esr at thyrsus.com
Fri Aug 16 19:01:21 UTC 2019


Sanjeev Gupta <ghane0 at gmail.com>:
> Eric,
> 
> On a 32-bit debian:
> 
> [ 73/101] Compiling ntpd/ntp_io.c
> ../../ntpd/ntp_scanner.c: In function ‘yylex’:
> ../../ntpd/ntp_scanner.c:40:30: warning: integer overflow in expression of
> type ‘long int’ results in ‘659554304’ [-Woverflow]
>  #define GPS_ERA_13BIT (8192L * SECONDS_IN_WEEK)
>                               ^
> ../../ntpd/ntp_scanner.c:940:20: note: in expansion of macro ‘GPS_ERA_13BIT’
>       era_offset += GPS_ERA_13BIT;

That is rather odd.  The L suffix on one of the multiplicands shhould have
clued in the compiler that the expression has type long.

What is sizeof(double) in that environment?

Attempt at a fix pushed. Let me know if it continues to complain.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>




More information about the devel mailing list