This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/80378] Extend alloc_size attribute for better Linux kernel checking


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

--- Comment #4 from Andi Kleen <andi-gcc at firstfloor dot org> ---
I tested it now and the inline trick doesn't work. Here's a test case

extern void *do_alloc(int a, int b);

static inline __attribute__((alloc_size(1))) void check_alloc_size(int size)
{
}

static inline void *alloc(int a, int b)
{
        check_alloc_size(a + b);
        return do_alloc(a, b);
}

void func(void)
{
        alloc(-1, 0);
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]