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

            Bug ID: 108136
           Summary: Modula2 meets cppcheck
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

I ran the C/C++ static analyser cppcheck over the source code of the Modula2
compiler and library.

For errors, this one might be significant:

trunk.d1/gcc/m2/pge-boot/GRTco.c:113:1: error: Found an exit path from function
with non-void return type that has missing return statement [missingReturn]

For style:

trunk.d1/gcc/m2/mc-boot/GM2Dependent.c:453:15: style: Array index 'i' is used
before limits check. [arrayIndexThenCheck]
trunk.d1/gcc/m2/pge-boot/GM2Dependent.c:461:15: style: Array index 'i' is used
before limits check. [arrayIndexThenCheck]
trunk.d1/gcc/m2/mc-boot/GArgs.c:86:42: style: Array index 'j' is used before
limits check. [arrayIndexThenCheck]
trunk.d1/gcc/m2/pge-boot/GArgs.c:84:42: style: Array index 'j' is used before
limits check. [arrayIndexThenCheck]
trunk.d1/gcc/m2/mc-boot/Gkeyc.c:603:241: style: Same expression 'seenUIntMax'
found multiple times in chain of '||' operators. [duplicateExpression]
trunk.d1/gcc/m2/mc-boot/Gkeyc.c:603:128: style: Same expression 'seenUIntMin'
found multiple times in chain of '||' operators. [duplicateExpression]

for performance, relatively little:

trunk.d1/gcc/m2/mc-boot/Gdecl.c:14011:58: performance: Function parameter 's'
should be passed by const reference. [passedByValue]
trunk.d1/gcc/m2/mc-boot/Gdecl.c:16906:57: performance: Function parameter 's'
should be passed by const reference. [passedByValue]
trunk.d1/gcc/m2/mc-boot/Gdecl.c:16918:64: performance: Function parameter 's'
should be passed by const reference. [passedByValue]

Reply via email to