https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122713

            Bug ID: 122713
           Summary: aarch64: internal enhancement: apply const across
                    source code
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

>From a recent run of static analyser cppcheck over
the gcc trunk source code:

trunk/gcc/config/aarch64/aarch64-early-ra.cc:1622:24: style: Parameter
'src_allocno' can be declared as pointer to const [constParameterPointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:2150:9: style: Variable
'src_allocno' can be declared as pointer to const [constVariablePointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:2272:17: style: Variable 'allocno'
can be declared as reference to const [constVariableReference]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:2393:45: style: Parameter
'allocno1' can be declared as pointer to const [constParameterPointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:2459:9: style: Variable 'allocno1'
can be declared as pointer to const [constVariablePointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:2460:9: style: Variable 'allocno2'
can be declared as pointer to const [constVariablePointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:2505:26: style: Parameter 'group2'
can be declared as pointer to const [constParameterPointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:2805:15: style: Variable
'candidate' can be declared as reference to const [constVariableReference]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:2812:18: style: Variable
'candidate' can be declared as reference to const [constVariableReference]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:2925:14: style: Variable 'copy'
can be declared as reference to const [constVariableReference]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:3037:13: style: Variable
'next_allocno' can be declared as pointer to const [constVariablePointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:3044:13: style: Variable 'group'
can be declared as pointer to const [constVariablePointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:3153:12: style: Variable
'next_allocno' can be declared as pointer to const [constVariablePointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:759:9: style: Variable 'chain_end'
can be declared as pointer to const [constVariablePointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:797:37: style: Parameter 'allocno'
can be declared as pointer to const [constParameterPointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:806:37: style: Parameter 'allocno'
can be declared as pointer to const [constParameterPointer]
trunk/gcc/config/aarch64/aarch64-early-ra.cc:878:10: style: Variable 'interval'
can be declared as reference to const [constVariableReference]
trunk/gcc/config/aarch64/aarch64-speculation.cc:273:17: style: Variable 'end'
can be declared as pointer to const [constVariablePointer]
trunk/gcc/config/aarch64/aarch64-sve-builtins.cc:1422:26: style: Variable
'state_flags' can be declared as const array [constVariable]
trunk/gcc/config/aarch64/aarch64-sve-builtins.cc:1562:9: style: Variable
'overload_name' can be declared as pointer to const [constVariablePointer]
trunk/gcc/config/aarch64/aarch64-sve-builtins.cc:4943:24: style: Variable 'rfn'
can be declared as reference to const [constVariableReference]
trunk/gcc/config/aarch64/aarch64-sve-builtins.cc:4975:24: style: Variable 'rfn'
can be declared as reference to const [constVariableReference]
trunk/gcc/config/aarch64/aarch64-sve-builtins-functions.h:289:11: style:
Variable 'suffix' can be declared as reference to const
[constVariableReference]
trunk/gcc/config/aarch64/cortex-a57-fma-steering.cc:476:49: style: Parameter
'chain' can be declared as pointer to const [constParameterPointer]
trunk/gcc/config/aarch64/cortex-a57-fma-steering.cc:730:47: style: Parameter
'forest' can be declared as pointer to const [constParameterPointer]
trunk/gcc/config/aarch64/driver-aarch64.cc:128:32: style: Parameter 'core' can
be declared as pointer to const [constParameterPointer]
trunk/gcc/config/aarch64/driver-aarch64.cc:232:28: style: Parameter 'arr' can
be declared as pointer to const [constParameterPointer]
trunk/gcc/config/aarch64/driver-aarch64.cc:283:9: style: Variable 'fcpu_info'
can be declared as pointer to const [constVariablePointer]

Then some others from elsewhere:

trunk/libffi/src/aarch64/ffi.c:333:24: style: Parameter 'dest' can be declared
as pointer to const [constParameterPointer]
trunk/libffi/src/aarch64/ffi.c:333:36: style: Parameter 'src' can be declared
as pointer to const [constParameterPointer]
trunk/libffi/src/aarch64/ffi.c:479:13: style: Variable 'rtype' can be declared
as pointer to const
[constVariablePointer]trunk/libffi/src/aarch64/ffi.c:631:17: style: Variable
'ty' can be declared as pointer to const [constVariablePointer]
trunk/libffi/src/aarch64/ffi.c:932:17: style: Variable 'ty' can be declared as
pointer to const [constVariablePointer]

Some of these might be worth fixing.

Reply via email to