On Tue, 9 Jan 2018, Prathamesh Kulkarni wrote:

As Jakub pointed out for the case:
void *f()
{
 return __builtin_malloc (0);
}

The malloc propagation would set f() to malloc.
However AFAIU, malloc(0) returns NULL (?) and the function shouldn't
be marked as malloc ?

Why not? Even for
void*f(){return 0;}
are any of the properties of the malloc attribute violated? It seems to
me that if you reject malloc(0), then even the standard malloc function
should be rejected as well...

--
Marc Glisse

Reply via email to