Re: [PATCH 1/6] parse-datetime, posixtm: avoid uninit access

2017-11-24 Thread Pádraig Brady
On 24/11/17 00:31, Paul Eggert wrote: > Pádraig Brady wrote: >> It's not introducing any new issue I think, but >> seems to be triggering the compiler warning due >> to tm_year being explicitly set? > > Actually, I think it's pointing out an issue with the API. If the caller to > posixtime were t

Re: [PATCH 1/6] parse-datetime, posixtm: avoid uninit access

2017-11-24 Thread Paul Eggert
Pádraig Brady wrote: It's not introducing any new issue I think, but seems to be triggering the compiler warning due to tm_year being explicitly set? Actually, I think it's pointing out an issue with the API. If the caller to posixtime were to specify neither PDS_LEADING_YEAR nor PDS_TRAILING_

Re: [PATCH 1/6] parse-datetime, posixtm: avoid uninit access

2017-11-23 Thread Pádraig Brady
On 25/09/17 18:29, Paul Eggert wrote: > * lib/parse-datetime.y (parse_datetime2): > * lib/posixtm.c (posixtime): > Do not access uninitialized storage, even though the resulting > value is never used. > --- > ChangeLog| 8 > lib/parse-datetime.y | 16 ++-- > lib/p

Re: [PATCH 1/6] parse-datetime, posixtm: avoid uninit access

2017-09-25 Thread Paul Eggert
Thien-Thi Nguyen wrote: Maybe add a preemptive comment, or factor the assignments into a macro (w/ comment)? It's not worth a macro. Feel free to add a comment.

Re: [PATCH 1/6] parse-datetime, posixtm: avoid uninit access

2017-09-25 Thread Thien-Thi Nguyen
() Paul Eggert () Mon, 25 Sep 2017 18:29:08 -0700 Do not access uninitialized storage, even though the resulting value is never used. [...] - tm0 = tm; + tm0.tm_sec = tm.tm_sec; + tm0.tm_min = tm.tm_min; + tm0.tm_hour = tm.tm_hour; + tm0.tm_mday

[PATCH 1/6] parse-datetime, posixtm: avoid uninit access

2017-09-25 Thread Paul Eggert
* lib/parse-datetime.y (parse_datetime2): * lib/posixtm.c (posixtime): Do not access uninitialized storage, even though the resulting value is never used. --- ChangeLog| 8 lib/parse-datetime.y | 16 ++-- lib/posixtm.c| 7 ++- 3 files changed, 28 inse