[TUHS] TUHS Digest, Vol 128, Issue 1

Nemo cym224 at gmail.com
Fri Sep 11 22:21:17 AEST 2015


On 11 September 2015 at 02:21, Rudi Blom <rudi.j.blom at gmail.com> wrote
(in part):
> I never used realloc(), only malloc() and calloc().
>
> Checking a few unixes I have access to all reallocs() seem to state
> either nothing on contents of memory added or state explicitly
> 'undefined'.

To be pedantic, if it's POSIX then:
(from http://pubs.opengroup.org/onlinepubs/9699919799/)
The contents of the new object shall be the same as that of the old
object prior to deallocation, up to the lesser of the new and old
sizes. Any bytes in the new object beyond the size of the old object
have indeterminate values.

N.



More information about the TUHS mailing list