This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v1] Port ndbm


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]