On Thu, May 31, 2012 at 12:28 PM, Tobias Burnus wrote:
> Dear all,
>
> gfortran was producing the following code:
>
> res = realloc (mem, size)
> if (size == 0)
> res = NULL;
> ...
> if (res != 0)
> free (res)
>
> The problem is that "realloc (..., 0)" does not have to produce a NULL
> p
On Thu, May 31, 2012 at 11:28:20AM +0200, Tobias Burnus wrote:
> I see two possibilities:
>
>
> 1) FIRST approach: manual freeing/NULL setting; that's the closed
> what is currently done. (Note: It calls free unconditionally;
> "free(0)" is optimized away by the middle end.
> (Note: That requires
Dear all,
gfortran was producing the following code:
res = realloc (mem, size)
if (size == 0)
res = NULL;
...
if (res != 0)
free (res)
The problem is that "realloc (..., 0)" does not have to produce a NULL
pointer as result.
While in "valgrind" one only gets the warning that