This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: Why was the reallocarray function not added to glibc?


On 03.04.2017 17:49, Szabolcs Nagy wrote:
On 03/04/17 16:21, Dennis Wölfing wrote:
The reallocarray function is a useful function that originates from OpenBSD and
that checks for overflow when (re)allocating memory. I saw in the mail archives
that a patch that implements reallocarray was already contributed in May 2014.

Here is the link: https://sourceware.org/ml/libc-alpha/2014-05/msg00481.html

However this patch was never applied even though I could not find any real
objections in the mail archives.

it violates iso c and posix namespace rules
https://sourceware.org/ml/libc-alpha/2014-05/msg00506.html

I think I have fixed the problems with that patch. My changes include:
- Updating the version number in malloc/Versions
- Adding reallocarray to the abilist files
- Wrapping the reallocarray declaration in #ifdef __USE_GNU
- Changing the reallocarray strong_alias into a weak_alias
Now the conform tests (and also the other tests) pass.

However because most of the patch was not written by me I am not sure what is the correct way to submit the updated patch.

Of course the patch should include the original ChangeLog entry by Rüdiger Sonderfeld. And perhaps I should add another ChangeLog for my changes to the abilists. But do I also need to create additional ChangeLog entries for files where I just changed a few lines of the original patch?

Also the original patch added new testcase file. Should the patch list 2014-2017 as the copyright date for that file because 2014 is year when it was written or should it be changed to say 2017?

Is there any reason to not add reallocarray to glibc? If not, should the patch
linked above be applied?

Dennis Wölfing


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