bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/4] mktime: prefer C23 style overflow checking


From: Bruno Haible
Subject: Re: [PATCH 1/4] mktime: prefer C23 style overflow checking
Date: Tue, 02 May 2023 21:01:23 +0200

Hi Paul,

> * lib/mktime.c: Include stdckdint.h, not intprops.h.

This patch triggers a compilation error in the 'diffutils' CI:

  CC       mktime.o
In file included from ../../../sources/diffutils/lib/mktime.c:53:
../../../sources/diffutils/lib/mktime.c:126:20: error: implicit declaration of 
function 'TYPE_MAXIMUM' [-Werror=implicit-function-declaration]
  126 | verify (INT_MAX <= TYPE_MAXIMUM (long_int) / 4 / 366 / 24 / 60 / 60);
      |                    ^~~~~~~~~~~~

You can also reproduce it directly from gnulib:

$ ./gnulib-tool --test --without-tests mktime
...
gcc -DHAVE_CONFIG_H -I. -I../../gllib -I..  -DGNULIB_STRICT_CHECKING=1   -g -O2 
-MT mktime.o -MD -MP -MF .deps/mktime.Tpo -c -o mktime.o ../../gllib/mktime.c
In file included from ../../gllib/mktime.c:53:
../../gllib/mktime.c:126:20: warning: implicit declaration of function 
‘TYPE_MAXIMUM’ [-Wimplicit-function-declaration]
  126 | verify (INT_MAX <= TYPE_MAXIMUM (long_int) / 4 / 366 / 24 / 60 / 60);
      |                    ^~~~~~~~~~~~

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]