Hi Darshit,

> Thanks for the guidelines. I've written a very rudimentary version of 
> the module. This is a barely working version

The implementation (.c file) looks good. However, it could be formatted
in GNU style (like the rest of gnulib, with very few exceptions, e.g. fts.c).

The module name should IMO be 'reallocarray'. We use the suffix '-gnu' only
when there is ambiguity between POSIX and GNU behaviour (e.g. for getopt).

> I know that this is missing:
> 1. An autoconf check
> 2. A way for reallocarray() to be defined within <stdlib.h>
> 3. Unit tests

And 4. A documentation file doc/glibc-functions/reallocarray.texi.

> for the other two, I don't know how to write them

1. Look at m4/strsep.m4.
2. grep for strsep and STRSEP in lib/string.in.h, m4/string_h.m4, 
   We use the same idioms everywhere.

> The glibc version is implemented behind the feature macro, _GNU_SOURCE.  
> I am not sure how that should be implemented into the module in gnulib.

The gnulib modules make their symbols visible unconditionally. That is, a
user that includes the gnulib module 'reallocarray' should be able to use
reallocarray() without defining _GNU_SOURCE by themselves. This is done through
an invocation of AC_USE_SYSTEM_EXTENSIONS from within m4/reallocarray.m4.


Reply via email to