Re: [PATCH v1] Port ndbm

"Craig Howland via newlib" <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On 7/10/19 4:55 AM, Vaibhav Gupta wrote:
> ---
>   newlib/libc/include/ndbm.h     |  93 ++++++++++++++
>   newlib/libc/search/Makefile.am |   1 +
>   newlib/libc/search/ndbm.c      | 217 +++++++++++++++++++++++++++++++++
>   3 files changed, 311 insertions(+)
>   create mode 100644 newlib/libc/include/ndbm.h
>   create mode 100644 newlib/libc/search/ndbm.c
>
> diff --git a/newlib/libc/include/ndbm.h b/newlib/libc/include/ndbm.h
> ...
> +typedef struct {
> +	void *dptr;
> +	int dsize;	/* XXX Should be size_t according to 1003.1-2008. */
If it is supposed to be size_t, then why isn't it?  I did verify that POSIX does 
specify size_t.  (Newlib is starting new here, so it would seem to make sense to 
make it right.  Does BSD have int just for legacy compatibility reasons?)
> +} datum;
> +
>
What about documentation (i.e. man page information)?
This is POSIX XSI.  Shouldn't there be some kind of gate?  (Or since the entire 
header is under XSI, no gate is needed since the user controls it on a file 
level?  I prefer this, but I don't know what general Newlib policy is, as most 
are mixed in and need individual gates.)
(These comments are purely focused on the internal contents of the proposal, and 
ignore the higher-level questions which have been under discussion about the 
__hash_open() prototype, etc.)
Craig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.