https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125269

Matthew Wilcox <matthew at wil dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matthew at wil dot cx

--- Comment #1 from Matthew Wilcox <matthew at wil dot cx> ---
I think this is the same thing I want.  I was going to ask for
__attribute__((free)) to indicate that a function frees memory.  eg this:

#include <stdlib.h>

struct x {
    unsigned long v;
};

void g(struct x *) __attribute__((free));
void h(unsigned long);

void f(struct x *x)
{
    g(x);
    h(x->v);
}

void k(struct x *x)
{
    free(x);
    h(x->v);
}

(function k gives the warning I want to see from function f)

I think what Andres is asking for gives me what I want.

Reply via email to