This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
function attributes on function pointers
- From: Tim Blechmann <tim at klingt dot org>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 20 Jun 2011 11:16:20 +0200
- Subject: function attributes on function pointers
- Followup-to: gmane.comp.gcc.help
hi all,
is there a way to use function attributes on function pointers?
my program uses a function table for a plugin interface, which includes a
function to allocate memory:
void* (*myAlloc)(Host * myHost, size_t size);
is it possible to use the malloc attribute for this to help the optimizer? i was
trying something like:
void* __attribute__ ((malloc))(*myAlloc)(Host * myHost, size_t size);
... but the attribute will be ignored ...
thanks, tim