Community
Participate
Working Groups
Build Identifier: 20110615-0604 Bugs are shown in editor ruler and project view even if build console shows no bugs. Reproducible: Always Steps to Reproduce: 1. Make a new C++ project. 2. Add a file main.cpp and type the program: #include <vector> #include <iostream> int main(void) { std::vector<int> tmp; tmp.push_back(1); std::cout<<tmp[0]<<std::endl; return 0; } 3. Compile. There are no errors in console view but ruler and and project view show bugs on the lines 6, 8 and 10.
Those "bugs" come from the Code Analysis feature. In my case it helps to rebuild the index (project context menu > Index > Rebuild).
(In reply to comment #1) Indeed, rebuilding index gets rid of some bugs, but not all of them. I think this "feature" is very misleading. I like to see the actual bugs, not something rubbish that code analysis tool creates. I think the in earlier versions of CDT the errors that code analysis tool showed, they were emphasized only with underlining and question mark and distinguished from the actual bugs. Now the the project view and editor ruler are corrupted with red crosses and bars. If you want to quickly find the actual bugs after building by looking for red bars and crosses in the editor rulers on the right and left, you can't do it anymore. Why on earth a decision to publish this kind of "feature" in the final product was made? If the code analysis tool does not work well enough to get rid of all the bugs (and I don't think it never will), this "feature" of CDT should still be considered as a bug.
(In reply to comment #2) > (In reply to comment #1) > > Indeed, rebuilding index gets rid of some bugs, but not all of them. I think > this "feature" is very misleading. I like to see the actual bugs, not something > rubbish that code analysis tool creates. I think the in earlier versions of CDT > the errors that code analysis tool showed, they were emphasized only with > underlining and question mark and distinguished from the actual bugs. Now the > the project view and editor ruler are corrupted with red crosses and bars. If > you want to quickly find the actual bugs after building by looking for red bars > and crosses in the editor rulers on the right and left, you can't do it > anymore. Why on earth a decision to publish this kind of "feature" in the final > product was made? If the code analysis tool does not work well enough to get > rid of all the bugs (and I don't think it never will), this "feature" of CDT > should still be considered as a bug. EDIT 1: Sorry I meant to say red bugs and bars in the editor rulers. A red cross is still shown in project view. EDIT 2: I forgot to mention that I don't think it's right that you have to know "the magic words" to build an index before you can reduce the number of code analysis errors. The behavior of CDT really should be more simple for end users. EDIT 3: I just noticed that the code analysis tool seems to do a worse job than in previous version (7.0.2). It doesn't recognize unique_ptr (c++0x) and some external libraries I'm using like openssl and libxml.
The indexer has improved a lot over the last couple of years. With CDT 8.2, I don't get any errors for your example code. That said, if you prefer that codan errors are not shown in the editor, you can disable them under Preferences -> C/C++ -> Code Analysis -> Syntax and Semantic Errors.
Closing, see Comment 4