tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: -current gcc optimizations and XEmacs



On Fri, Oct 28, 2016 at 01:22:10PM +0000, Christos Zoulas wrote:
> Delete the function. gcc detects 
> 
>     ptr = malloc(nmemb * size);
>     memset(ptr, 0, nmemb * size);
> 
> and changes it into:
> 
>     calloc(nmemb, size);
> 
> so the function ends up being:
> 
>     __ptr_t
>     calloc (__malloc_size_t nmemb, __malloc_size_t size)
>     {
> 	    return calloc(nmemb, size);
>     }
> 
> and that does not work very will as you noticed :-)

It's clearly a GCC bug to do this. Deleting calloc doesn't help as it
will just result in inconsistent definitions of malloc/realloc vs calloc
to be used.

Joerg


Home | Main Index | Thread Index | Old Index