bug-gnulib
[Top][All Lists]
Advanced

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

Re: FYI: address coreutils' gcc9 build failures


From: Bruno Haible
Subject: Re: FYI: address coreutils' gcc9 build failures
Date: Mon, 25 Jun 2018 03:36:10 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-128-generic; KDE/5.18.0; x86_64; ; )

Jim Meyering wrote:
> diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y
> index f14bb31dc..3d8666a4d 100644
> --- a/lib/parse-datetime.y
> +++ b/lib/parse-datetime.y
> @@ -1766,6 +1766,11 @@ parse_datetime2 (struct timespec *result, char const 
> *p,
> 
>    timezone_t tz = tzdefault;
> 
> +  /* Store a local copy prior to first "goto".  Without this, a prior use
> +     below of RELATIVE_TIME_0 on the RHS might translate to an assignment-
> +     to-temporary, which would trigger a -Wjump-misses-init warning.  */
> +  static const relative_time rel_time_0 = RELATIVE_TIME_0;
> +
>    if (strncmp (p, "TZ=\"", 4) == 0)
>      {
>        char const *tzbase = p + 4;

With gcc 4.8.5, this produces a compilation error:

  CC       lib/parse-datetime.o
parse-datetime.y: In function 'parse_datetime2':
parse-datetime.y:1772:3: error: initializer element is not constant
make[2]: *** [lib/parse-datetime.o] Error 1

Workaround: Remove the word 'static' from line 1772.

Bruno




reply via email to

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