[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Does gnulib getcwd always allocate if buf is NULL?
From: |
Bruno Haible |
Subject: |
Re: Does gnulib getcwd always allocate if buf is NULL? |
Date: |
Wed, 06 Mar 2024 21:45:29 +0100 |
Reuben Thomas wrote:
> > > > 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.
> ...
> 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.
You have understood it: "In GNU", here, means "when following the glibc
conventions". And Gnulib brings the glibc conventions to other platforms.
There's no need to change this comment, because the primary places to look
for a function's behaviour are:
1. the documentation and standard documents,
2. the .h file (in this case: unistd.in.h line 1121).
Bruno