[tz] gcc 8 demanded patch (from NetBSD)

Bradley White bww at acm.org
Wed May 10 02:48:55 UTC 2017


It looks like "hit" erroneously became a bool in commit "Use bool for
boolean
<https://github.com/eggert/tz/commit/7eb7c7349c80e28c531b65d7d196a1bac279aa1c#diff-693adf4be7e59d555ff5f36e00300de7>"
on Aug 20, 2014.  It shouldn't be one.  That ++hit is within a loop that
would execute should there be a double (or triple ...) leap.

Admittedly, there has never been a double leap, and the powers-that-be
would probably change the "end of June/December" rule first should we get
close to needing one before leap seconds are abolished altogether, but that
doesn't mean we shouldn't simply allow for them.

On Tue, May 9, 2017 at 8:23 PM, Robert Elz <kre at munnari.oz.au> wrote:

> The following patch was recently added to NetBSD, to appease
> GCC 8 (apparently) ... "hit" is a bool, and it seems gcc 8 does
> not like ++ operators applied to one of those.
>
> (deleted parts of the diff which just showed the version ID string
> being updated...)
>
> kre
>
> Index: src/lib/libc/time/localtime.c
> diff -u src/lib/libc/time/localtime.c:1.106 src/lib/libc/time/localtime.c:
> 1.107
> --- src/lib/libc/time/localtime.c:1.106 Sat Mar 11 18:23:14 2017
> +++ src/lib/libc/time/localtime.c       Tue May  9 02:30:49 2017
> @@ -1716,7 +1716,7 @@ timesub(const time_t *timep, int_fast32_
>                                                 sp->lsis[i - 1].ls_trans +
> 1 &&
>                                                 sp->lsis[i].ls_corr ==
>                                                 sp->lsis[i - 1].ls_corr +
> 1) {
> -                                                       ++hit;
> +                                                       hit = true;
>                                                         --i;
>                                         }
>                         }
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mm.icann.org/pipermail/tz/attachments/20170509/dca12590/attachment.html>


More information about the tz mailing list