On Wed, 6 Mar 2024 at 20:12, Bruno Haible <br...@clisp.org> wrote:

> Reuben Thomas wrote:
> > In getcwd.c I find the following comment:
>
> The Gnulib documentation
> https://www.gnu.org/software/gnulib/manual/html_node/getcwd.html
> points to the specification. That's usually a more solid reference than
> a comment in the code.
>

Thanks, it seems that the documentation supports my guess.

> In GNU, if BUF is NULL, an array is allocated with 'malloc'; the array is
> > > SIZE bytes long, unless SIZE == 0, in which case it is as big as
> necessary.
> > >
> >
> > However, as far as I can see from the code, it always allocates if BUF is
> > NULL.
>
> What is your question?


Would this comment be better if "In GNU," was deleted? The comment implies
that the implementation only behaves as specified after the comma on GNU
systems, when in fact a particular feature of the gnulib implementation is
to bring the GNU behaviour to non-GNU systems.

-- 
https://rrt.sc3d.org

Reply via email to