Pádraig Brady wrote:
> The new coreutils CI I have in place is failing to build
> with gcc (Debian 10.2.1-6) 10.2.1 with gnulib latest (ebd843b3) as follows.
> lib/utimecmp.c: In function 'utimecmpat':
> lib/utimecmp.c:348:17: error: missing initializer for field 'tv_nsec' of
> 'struct timespec'
Paul Eggert wrote:
> @@ -143,8 +142,7 @@ gettimeofday (struct timeval *restrict tv, void *restrict
> tz)
> # error "Only 1-second nominal clock resolution found. Is that intended?"
> \
>"If so, compile with the -DOK_TO_USE_1S_CLOCK option."
> # endif
> - tv->tv_sec = time
On 15/05/2023 07:30, Paul Eggert wrote:
This problem was found when compiling GNU Emacs with
--enable-gcc-warnings on a platform where tv_sec is 64 bits and
tv_nsec is 32 bits, and struct timespec has padding. GCC
-Wuse-of-uninitialized-value complained when a struct timespec
initialized only
Paul Eggert wrote:
> diff --git a/lib/select.c b/lib/select.c
> index 6b6ca4154c..991f475431 100644
> --- a/lib/select.c
> +++ b/lib/select.c
> @@ -516,7 +516,7 @@ restart:
>goto restart;
> }
>if (timeout && wait_timeout == 0 && rc == 0)
> -timeout->tv_sec =
Paul Eggert wrote:
> diff --git a/lib/poll.c b/lib/poll.c
> index a0dc2c5226..941fecf2d3 100644
> --- a/lib/poll.c
> +++ b/lib/poll.c
> @@ -396,14 +396,15 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout)
>if (timeout == 0)
> {
>ptv =
> - ptv->tv_sec = 0;
> -
This problem was found when compiling GNU Emacs with
--enable-gcc-warnings on a platform where tv_sec is 64 bits and
tv_nsec is 32 bits, and struct timespec has padding. GCC
-Wuse-of-uninitialized-value complained when a struct timespec
initialized only via assigning to tv_sec and tv_nsec was