Review Request 128591: error location fix

Anton Anikin anton.anikin at htower.ru
Wed Aug 3 23:42:13 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128591/
-----------------------------------------------------------

(Updated Aug. 3, 2016, 11:42 p.m.)


Review request for KDevelop.


Changes
-------

new test in tests/test_cppcheckparser.cpp


Repository: kdev-cppcheck


Description
-------

Let some test.cpp file contain such code:

int x = 0; // line 100

.... // lines, which don't use the value of 'x' variable

x = 10; // line 120

Then cppcheck will produce such XML output:

<error id="redundantAssignment" ... >
    <location file="test.cpp" line="120"/>
    <location file="test.cpp" line="100"/>
</error>

Old code set error location to line 100 of test.cpp (last <location> element), but it's wrong behaviour - error position must be at line 120. Current (new) version uses only first <location> element of the <error> item for getting information about error position.


Diffs (updated)
-----

  parsers/cppcheckparser.cpp aad0dca 
  tests/test_cppcheckparser.cpp ff017e6 

Diff: https://git.reviewboard.kde.org/r/128591/diff/


Testing
-------


Thanks,

Anton Anikin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160803/e62b234a/attachment.html>


More information about the KDevelop-devel mailing list