[PATCH v2 3/6] nss: Add tests for the nss_hash in nss_hash.h
Florian Weimer
fweimer@redhat.com
Tue Apr 26 08:35:59 GMT 2022
* Noah Goldstein:
> On Mon, Apr 25, 2022 at 10:38 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * Noah Goldstein via Libc-alpha:
>>
>> > +static int
>> > +do_fill_tests (size_t len, int fill)
>> > +{
>> > + uint32_t expec, res;
>> > + char buf[len];
>> > + memset (buf, fill, len);
>> > +
>> > + expec = simple_nss_hash (buf, len);
>> > + res = __nss_hash (buf, len);
>> > + if (expec != res)
>> > + {
>> > + printf ("FAIL: fill(%d) (%lu), %x != %x\n", fill, len, expec, res);
>> > + return 1;
>> > + }
>> > +
>> > + return 0;
>> > +}
>>
>> %lu needs to be %zu, otherwise this fails to build on various
>> architectures.
>
> Fixed in v3.
Thanks; I can confirm the new version builds fine.
Florian
More information about the Libc-alpha
mailing list