gicho / cppcheclipse

Automatically exported from code.google.com/p/cppcheclipse
0 stars 0 forks source link

clicking on error/warning in Problem window does not transfer to correct line number of file #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
First installed cppcheclipse plug-in. Selected all the projects in the
workspace >20. Right-clicked and ran cppcheck. Received a list of errors
and warnings. Clicking on the errors/warnings showed me the code line that
needed to be changed.

Corrected a few errors/warnings, especially the 'throwing exception in
destructor not recommended'.

Now when I double click on the warning, the location in the file I am shown
is a comment line, not code.

Is there a 'caching' problem, an indexing problem, etc.?

Original issue reported on code.google.com by keith.sm...@pb.com on 16 Nov 2009 at 7:38

GoogleCodeExporter commented 8 years ago
If you change something in a file, which contains markers from cppcheclipse, the
markers may become invalid, since they are not updated, until you rerun 
cppcheclipse
again on that file. To make that happen automatically, you can make 
cppcheclipse run
on every build, which is by default executed, when the file is saved. What other
behaviour would you expect?

Original comment by konra...@gmx.de on 16 Nov 2009 at 7:58

GoogleCodeExporter commented 8 years ago
I'm sorry I did not make myself clear earlier.

After I made the code changes recommended by cppcheck, I deleted all the
errors/warnings from the Problem window, cleaned the project, rebuilt the 
project,
then ran the cppcheck scan.

clicking on the new error/warnings displayed still results in the location shown
being a comment, not code.

Original comment by keith.sm...@pb.com on 16 Nov 2009 at 8:10

GoogleCodeExporter commented 8 years ago
Sorry, I tried to reproduce it, but wasn't successfull. Unfortunately I still 
don't
really know what steps need to be executed to reproduce the problem. Could you 
give a
small source code example for both states, before and after the error is fixed 
which
was reported by cppcheck. Did you delete the error markers manually, or did you 
just
rebuild the whole project. Was cppcheck automatically executed during build or
manually executed via the context menu?

Original comment by konra...@gmx.de on 21 Nov 2009 at 6:30

GoogleCodeExporter commented 8 years ago
I finally found the problem. So far the markers attributes were not set in an
workspace atomic operation. So depending on the listener threads, they may 
update the
marker too soon, when not all attributes are correctly set. This behaviour is
described here:
http://wiki.eclipse.org/FAQ_Why_don%27t_my_markers_appear_in_the_editor%27s_vert
ical_ruler%3F.
This sometimes leads to markers at wrong positions.

Original comment by konra...@gmx.de on 22 Nov 2009 at 3:03

GoogleCodeExporter commented 8 years ago

Original comment by konra...@gmx.de on 22 Nov 2009 at 6:28