[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Minor Comments on Gmake Internals
From: |
Paul Smith |
Subject: |
Re: Minor Comments on Gmake Internals |
Date: |
Sat, 18 Dec 2021 09:15:54 -0500 |
User-agent: |
Evolution 3.36.5-0ubuntu1 |
On Fri, 2021-12-17 at 20:22 -0800, Jon Forrest wrote:
> 4) In tracing the startup execution of gmake, I see lots of calls to
> expand.c/variable_buffer_output() with a length of 0. Is this as
> expected? Such calls don't accomplish anything.
Well, if we're calling this function with a length of strlen() and the
string we're appending can be empty (which is obviously quite possible
because all sorts of variables, expansions, etc. can be empty) then
we'll call this function with a length of 0.
There's no way to avoid this other than adding a check for a length of
0 to every caller of the function, which obviously we don't want to do.