On Sat, 6 Sep 2025, Martin Uecker wrote:

> 
> This is the revised version adding the test to C_DECL_REGISTER.
> This meant I also had to change one place where it is set on
> function declarators before it becomes an error.
> 
> Bootstrapped and regression tested on x86_64.
> 
> Martin
> 
> 
>     c: Warn when returning nested functions that require a non-local context.
>     
>     This patch adds a mechanism to keep track whether nested functions require
>     non-local context because they reference a variable of an enclosing
>     scope.  This is used for extending the existing -Wreturn-address warning
>     to also warn for such nested functions.  Certain exceptions are 
> implemented
>     for functions that do not requite a non-local context, because they 
> reference
>     only static variables, named constants, non-local variables in unevaluated
>     sizeof, typeof or countof operators, or typedef.  The logic is based on 
> the
>     existing infrastructure for determining use of undeclared static 
> functions.
>     Finally, To make sure that no trampolines are generated even when not 
> using
>     optimization, we mark the exempt functions with TREE_NO_TRAMPOLINE.

OK.

-- 
Joseph S. Myers
josmy...@redhat.com

Reply via email to