Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75217

cppcheck issues with missingOverride: multiple locations not shown

      When cppcheck finds a missingOverride, it puts 2 <location>s in the xml. like htis:

       

          <error id="missingOverride" severity="style" msg="The function 'reset' overrides a function in a base class but is not marked with a 'override' specifier." verbose="The function 'reset' overrides a function in a base class but is not marked with a 'override' specifier.">
                  <location file="derived.hpp" line="115" column="7" info="Function in derived class"/>
                  <location file="base.hpp" line="117" column="15" info="Virtual function in base class"/>
                  <symbol>reset</symbol>
              </error>

      Clearly, the error is in the derived.hpp file. However, the result with the cppcheck parser is that it lists this as an issue in the base.hpp file, and the derived.hpp is not even mentioned, so you are left in the dark as to where to the problem is, even though the information is available in the xml.

      Proposed fix: if multiple locations, take the first, not the last. And maybe add the last as text to the detail of the issue, just like the 'info' part is added already.

          [JENKINS-75217] cppcheck issues with missingOverride: multiple locations not shown

            Unassigned Unassigned
            legolas1 a
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: