This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] time/tst-strptime2.c: test full input range +/- 0-9999
- From: James Perkins <james at loowit dot net>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: GNU libc <libc-alpha at sourceware dot org>, Paul Eggert <eggert at cs dot ucla dot edu>
- Date: Mon, 17 Aug 2015 12:52:10 -0700
- Subject: Re: [PATCH 2/2] time/tst-strptime2.c: test full input range +/- 0-9999
- Authentication-results: sourceware.org; auth=none
- References: <1439667772-16906-1-git-send-email-james at loowit dot net> <1439667772-16906-3-git-send-email-james at loowit dot net> <20150816143119 dot GI12511 at vapier> <CAJ2jFj4AoFWK20K5vdCLVGSzsVXDT_YkeaVB6OYKax5REqcHKw at mail dot gmail dot com> <55D2268E dot 1040208 at redhat dot com>
On Mon, Aug 17, 2015 at 11:23 AM, Carlos O'Donell <carlos@redhat.com> wrote:
> On 08/17/2015 01:33 PM, James Perkins wrote:
>> - bool test_string_valid = retval ? 1 : 0;
>> + int test_string_valid = retval ? 1 : 0;
>>
>> I'm going to hold a day or two to hear from Carlos first, then post a
>> new patchset with the above change.
>
> This is an implicit boolean coercion. Please be explicit about truth
> values e.g. `int test_string_valid = retval > 1 ? 1 : 0;`.
>
> https://sourceware.org/glibc/wiki/Style_and_Conventions#Boolean_Coercions
That is definitely useful advice. I think I will use bool anyway in V6.
> Other than that, the v5 looks almost ready, and with Mike's suggested
> changes I think v6 is probably the final polished version.
Patch coming shortly.
Cheers,
James