Nested functions and tail-call optimization
Ludovic Courtès
ludo@gnu.org
Mon Aug 20 11:59:00 GMT 2012
Hi,
Consider this function:
static tree filter (bool (*pred) (const_tree), tree);
static tree
list_remove (bool (*pred) (const_tree), tree t)
{
bool opposite (const_tree t)
{
return !pred (t);
}
return filter (opposite, t);
}
Here, the call to âfilterâ is likely subject to tail-call optimization.
Is there any guarantee that âoppositeâ is still reachable when âfilterâ
is called?
Thanks,
Ludoâ.
More information about the Gcc-help
mailing list