A common convention in Upstart+NIH is for functions to accept a parent pointer as in the following example:
Foo *make_foo (const void *parent) __attribute__ ((malloc)); Foo * make_foo (const void *parent) { Foo *foo = nih_new (parent, Foo); /* ... */ return foo; } But, if I'm understanding this correctly (?), using the malloc attribute here is also invalid iff parent != NULL since nih_new() ultimately saves the value of foo to the parents context before returning the address of foo. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1123588 Title: wrong usage of the `malloc' function attribute To manage notifications about this bug go to: https://bugs.launchpad.net/gcc/+bug/1123588/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs