This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] nisplus: Correct pwent parsing issue and resulting compilation error [BZ #23266]
- From: DJ Delorie <dj at redhat dot com>
- To: "Maciej W. Rozycki" <macro at mips dot com>
- Cc: schwab at suse dot de, libc-alpha at sourceware dot org
- Date: Mon, 18 Jun 2018 16:40:01 -0400
- Subject: Re: [PATCH v2] nisplus: Correct pwent parsing issue and resulting compilation error [BZ #23266]
"Maciej W. Rozycki" <macro@mips.com> writes:
>> + if (len > 0)
>> strncpy (first_unused, numstr, len);
>
> Do you expect GCC to start complaining here sometime even if it cannot
> statically prove that `len' can sometimes be zero, which seems the case
> here?
I wouldn't expect gcc to complain here, no, but... some of the things
gcc *does* complain about have surprised me in the past. So this is
just my paranoia asserting itself :-)
(and function calls used to be expensive, so my old optimizing tricks
are speaking up ;)
> But as you write, is it worth it?
I doubt it. Just being thorough.