From: Alejandro Colomar Date: Sun, 2 Nov 2025 18:45:36 +0000 (+0100) Subject: gcc/: Reduce scope of local variable (refactor) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1274212dc934e4f623df76ec038b3b8d214ebe8;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/c-family/c-warn.cc b/gcc/c-family/c-warn.cc index cc127de2488..d50129f0396 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);