Re: Feature Request: Implement glibc reallocarray() function

2017-08-15 Thread Darshit Shah
* Bruno Haible [170814 21:41]: Hi Darshit, Thank you very much for your patience, to go through these details for your first major gnulib contributions! I appreciate it a lot. Bruno I'd like to thank everyone here who helped me along the way making sure that the patch was made perfectly. A

Re: Feature Request: Implement glibc reallocarray() function

2017-08-14 Thread Bruno Haible
Hi Darshit, Thank you very much for your patience, to go through these details for your first major gnulib contributions! I appreciate it a lot. Bruno

Re: Feature Request: Implement glibc reallocarray() function

2017-08-14 Thread Bruno Haible
Paul Eggert wrote: > When talking about a function FOO, say just "FOO", not "FOO()". Use the > latter > form only when talking about calls to FOO with zero arguments. Except that in the module description, we use 'FOO()' as a kind of markup, in order to insert a hyperlink to the POSIX standard

Re: Feature Request: Implement glibc reallocarray() function

2017-08-14 Thread Bruno Haible
Darshit Shah wrote: > what is the first NetBSD version that includes `reallocarray`? You can infer this from the CVS log of the NetBSD sources: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdlib/reallocarr.c Bruno

Re: Feature Request: Implement glibc reallocarray() function

2017-08-14 Thread Bruno Haible
Paul Eggert wrote: > > The function is not present on any other system, I checked. > > It was introduced in OpenBSD 5.6 and was added to FreeBSD in 11.1. Oops, my database of libc symbols per platform was not updated in a while. Sorry. Bruno

Re: Feature Request: Implement glibc reallocarray() function

2017-08-13 Thread Paul Eggert
Darshit Shah wrote: I hope everything is now in order this can be merged into master Thanks, it's close enough. I installed it along with the attached minor cleanups. From aa459ef443c756c28ce883fdd7f15c98fcefc7dc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 13 Aug 2017 10:55:55 -0700

Re: Feature Request: Implement glibc reallocarray() function

2017-08-13 Thread Darshit Shah
* Paul Eggert [170813 09:15]: Darshit Shah wrote: what is the first NetBSD version that includes `reallocarray`? I would say NetBSD 8. But that's not what the text is about. The text doesn't talk about the first NetBSD version that includes 'reallocarray'. It talks about the last version th

Re: Feature Request: Implement glibc reallocarray() function

2017-08-13 Thread Darshit Shah
* Paul Eggert [170810 23:23]: Darshit Shah wrote: This page was written in 2015. However, on netbsd.org, NetBSD 7.1 is the current latest release. Also, when exactly do we consider reallocarray being available in NetBSD since the page only states that the redesigned version, reallocarr (note

Re: Feature Request: Implement glibc reallocarray() function

2017-08-13 Thread Paul Eggert
Darshit Shah wrote: what is the first NetBSD version that includes `reallocarray`? I would say NetBSD 8. But that's not what the text is about. The text doesn't talk about the first NetBSD version that includes 'reallocarray'. It talks about the last version that is missing 'reallocarray'. As

Re: Feature Request: Implement glibc reallocarray() function

2017-08-10 Thread Paul Eggert
Darshit Shah wrote: This page was written in 2015. However, on netbsd.org, NetBSD 7.1 is the current latest release. Also, when exactly do we consider reallocarray being available in NetBSD since the page only states that the redesigned version, reallocarr (note the missing 'ay') is available f

Re: Feature Request: Implement glibc reallocarray() function

2017-08-10 Thread Darshit Shah
* Paul Eggert [170810 16:51]: Thanks, a few more things (hopefully we're getting to the end now). "missing on many platforms" lists reallocarray as missing in FreeBSD 11.1, NetBSD 8.0, and OpenBSD 5.6. But it's not missing in those versions: those are the versions it was first introduced.

Re: Feature Request: Implement glibc reallocarray() function

2017-08-10 Thread Paul Eggert
Thanks, a few more things (hopefully we're getting to the end now). "missing on many platforms" lists reallocarray as missing in FreeBSD 11.1, NetBSD 8.0, and OpenBSD 5.6. But it's not missing in those versions: those are the versions it was first introduced. Please fit ChangeLog entries to 7

Re: Feature Request: Implement glibc reallocarray() function

2017-08-09 Thread Darshit Shah
You're right. I missed that part. Here's an updated version * Paul Eggert [170809 11:58]: Darshit Shah wrote: +This function is missing on all non-glibc platforms: glibc 2.25 No, as I mentioned it's present in the three main BSD platforms. Please change "all non-glibc" to "many", and updat

Re: Feature Request: Implement glibc reallocarray() function

2017-08-09 Thread Paul Eggert
Darshit Shah wrote: > +This function is missing on all non-glibc platforms: glibc 2.25 No, as I mentioned it's present in the three main BSD platforms. Please change "all non-glibc" to "many", and update the version numbers for FreeBSD etc. to match my earlier email.

Re: Feature Request: Implement glibc reallocarray() function

2017-08-09 Thread Darshit Shah
Hi Bruno, Thanks for all your help. I've attached an updated version of the patch which should now be (almost) complete. I've taken into account everything that Paul and you mentioned in the last mail. * Bruno Haible [170809 10:59]: Hi Darshit, Looks quite complete now. Other than what Pau

Re: Feature Request: Implement glibc reallocarray() function

2017-08-08 Thread Paul Eggert
Bruno Haible wrote: The function is not present on any other system, I checked. It was introduced in OpenBSD 5.6 and was added to FreeBSD in 11.1. Hmm, the NetBSD man page says it's available in NetBSD 8 in the _OPENBSD_SOURCE namespace, which is news to me. This means the extensions module n

Re: Feature Request: Implement glibc reallocarray() function

2017-08-08 Thread Bruno Haible
Hi Darshit, Looks quite complete now. Other than what Paul mentioned: * You appear to be using tabs of widths 4. Therefore use "expand -t 4" to untabify the files you modified. * The documentation: - Could you add an URL to the documentation of this function? (glibc manual or, if not ava

Re: Feature Request: Implement glibc reallocarray() function

2017-08-08 Thread Paul Eggert
Darshit Shah wrote: It seems to me that I have not managed to correctly coerce stdlib.h into defining a prototype for reallocarray(). Where did I go wrong / what did I miss? Look at other GNU extensions in stdlib.in.h. canonicalize_file_name, say. Also, please use GNU styile everywhere. No ta

Re: Feature Request: Implement glibc reallocarray() function

2017-08-08 Thread Darshit Shah
Hi, My last patch was incomplete. It did not contain the unit tests. I have attached the updated patch file. However, it does not work and fails the test. It seems to me that I have not managed to correctly coerce stdlib.h into defining a prototype for reallocarray(). Where did I go wrong /

Re: Feature Request: Implement glibc reallocarray() function

2017-08-08 Thread Darshit Shah
Hi Bruno, Thanks for your help. I've made the changes you mentioned and attached a new version of the patch. Do let me know if something is missing. I am not sure of how the documentation should be written. Specifically, which platforms this module is targeting. * Bruno Haible [170808 14:4

Re: Feature Request: Implement glibc reallocarray() function

2017-08-08 Thread Bruno Haible
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 nam

Re: Feature Request: Implement glibc reallocarray() function

2017-08-08 Thread Darshit Shah
Hi Bruno, Thanks for the guidelines. I've written a very rudimentary version of the module. This is a barely working version, but I do not know what else I require to complete the module. I know that this is missing: 1. An autoconf check 2. A way for reallocarray() to be defined within 3. Un

Re: Feature Request: Implement glibc reallocarray() function

2017-08-07 Thread Paul Eggert
Bruno Haible wrote: You can start out by looking at the implementation of module 'strsep' Another suggestion: Gnulib reallocarray should use Gnulib's xalloc_oversized macro instead of the glibc check_mul_overflow_size_t function. See the xalloc-oversized module.

Re: Feature Request: Implement glibc reallocarray() function

2017-08-07 Thread Bruno Haible
Hi Darshit, > Glibc 2.26 introduced the reallocarray() function which acts as a safe > realloc counterpart to calloc(). ... If others here agree, I'd like to see > this > function within in gnulib. Yes, a portable replacement of this function belongs in gnulib. It falls both in the categories

Feature Request: Implement glibc reallocarray() function

2017-08-07 Thread Darshit Shah
Hi, Glibc 2.26 introduced the reallocarray() function which acts as a safe realloc counterpart to calloc(). I'd like to use this in GNU Wget but since it is not easily available on all systems, I guess we should have an implementation in gnulib. If others here agree, I'd like to see this func