https://gcc.gnu.org/g:f1274212dc934e4f623df76ec038b3b8d214ebe8
commit r16-5175-gf1274212dc934e4f623df76ec038b3b8d214ebe8 Author: Alejandro Colomar <[email protected]> Date: Sun Nov 2 19:45:36 2025 +0100 gcc/: Reduce scope of local variable (refactor) No functional change intended. gcc/c-family/ChangeLog: * c-warn.cc (warn_parms_array_mismatch): Reduce scope of local variable. Signed-off-by: Alejandro Colomar <[email protected]> Diff: --- gcc/c-family/c-warn.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/c-family/c-warn.cc b/gcc/c-family/c-warn.cc index cc127de24882..d50129f0396e 100644 --- a/gcc/c-family/c-warn.cc +++ b/gcc/c-family/c-warn.cc @@ -3470,10 +3470,6 @@ warn_parms_array_mismatch (location_t origloc, tree fndecl, tree newparms) such as between f(T*) and f(T[1]), where the former mapping would be empty. */ - /* Create an empty access specification and use it for pointers with - no spec of their own. */ - attr_access ptr_spec = { }; - /* Iterate over the two lists of function parameters, comparing their respective mappings and diagnosing mismatches. */ unsigned parmpos = 0; @@ -3484,6 +3480,10 @@ warn_parms_array_mismatch (location_t origloc, tree fndecl, tree newparms) /* Bail on invalid redeclarations with fewer arguments. */ return; + /* Create an empty access specification and use it for pointers with + no spec of their own. */ + attr_access ptr_spec = { }; + /* Only check pointers and C++ references. */ tree curptype = TREE_TYPE (curp); tree newptype = TREE_TYPE (newp);
