2018-06-24 Jim Meyering <meyering@fb.com>
+ parse-datetime.y: avoid spurious GCC 9 warning
+ * lib/parse-datetime.y (parse_datetime2): Save RELATIVE_TIME_0 into
+ a function local prior to the first "goto fail". The prior use would
+ evoke this:
+ parse-datetime.y: In function 'parse_datetime2':
+ parse-datetime.y:1791:19: error: jump skips variable initialization \
+ [-Werror=jump-misses-init]
+ parse-datetime.y:2385:2: note: label 'fail' defined here
+ parse-datetime.y:188:43: note: '({anonymous})' declared here
+ parse-datetime.y:1841:12: note: in expansion of macro 'RELATIVE_TIME_0'
+
canon-host.c: avoid spurious GCC 9 warning
* lib/canon-host.c: Suppress GCC9's -Wsuggest-attribute=malloc.
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;
tm.tm_isdst = tmp.tm_isdst;
pc.meridian = MER24;
- pc.rel = RELATIVE_TIME_0;
+ pc.rel = rel_time_0;
pc.timespec_seen = false;
pc.rels_seen = false;
pc.dates_seen = 0;