Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351831 - Codan does not handle 3rd party enumeration well
Summary: Codan does not handle 3rd party enumeration well
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: CDT Codan Inbox CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-12 09:02 EDT by MedZed CLA
Modified: 2011-07-14 10:02 EDT (History)
4 users (show)

See Also:


Attachments
Screencap of the problem (320.82 KB, image/png)
2011-07-12 09:03 EDT, MedZed CLA
no flags Details
Header file with enum (1.81 KB, text/x-chdr)
2011-07-12 13:47 EDT, MedZed CLA
no flags Details
Main function for test project (542 bytes, text/x-c++src)
2011-07-12 13:48 EDT, MedZed CLA
no flags Details
Screencap of simple project w/ codan problem (283.63 KB, image/png)
2011-07-12 13:49 EDT, MedZed CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description MedZed CLA 2011-07-12 09:02:15 EDT
Build Identifier: 20110615-0604

I have a file with code that compiles just fine, but with the inclusion of Codan in Indigo, Eclipse is telling me I have a problem that I believe is incorrect.  When I use a type from a header file provided from a vendor, codan tells me it cannot resolve the type.  So if I use a variable of that type in an if() statement or as a return value from a function, codan barfs.

I'm attaching a screen shot and will put some code up if needed.

Reproducible: Always

Steps to Reproduce:
1. Declare a typedefed enum in a header
2. Make a varialbe of that type in a cpp file
3. Use the variable.  Codan barfs.
Comment 1 MedZed CLA 2011-07-12 09:03:01 EDT
Created attachment 199491 [details]
Screencap of the problem
Comment 2 Marc-André Laperle CLA 2011-07-12 12:58:27 EDT
I can't reproduce this, can you provide some code? Also, try rebuilding the index (Right-click on project, Index, Rebuild).
Comment 3 MedZed CLA 2011-07-12 13:47:12 EDT
Tried performing the Index rebuild, no help. 

I made a clean build with a very simple main and copy/pasted the offending enum.  I will put both files up here, simply make a new empty C++ project and put these two files in.  You should get the same error (I'll screencap as well).
Comment 4 MedZed CLA 2011-07-12 13:47:48 EDT
Created attachment 199517 [details]
Header file with enum
Comment 5 MedZed CLA 2011-07-12 13:48:09 EDT
Created attachment 199518 [details]
Main function for test project
Comment 6 MedZed CLA 2011-07-12 13:49:12 EDT
Created attachment 199519 [details]
Screencap of simple project w/ codan problem
Comment 7 Marc-André Laperle CLA 2011-07-12 13:57:51 EDT
That works for me too. Can you try the same simple project in a new workspace?
Comment 8 MedZed CLA 2011-07-13 09:25:35 EDT
(In reply to comment #7)
> That works for me too. Can you try the same simple project in a new workspace?

I created a whole brand new workspace and then copied the source files into a brand new project and it yielded the same result.

Could it be an issue with plug ins I may have?  Or perhaps CODAN settings?  Do you have something turned off in the Codan settings that is on by default?

The only plugin I've added on top of the C++ Linux Eclipse package is CUTE, a unit testing framework.
Comment 9 Marc-André Laperle CLA 2011-07-13 20:05:09 EDT
It has to be some plug-in. I don't think we check for operator usage at all in the current checkers and I can't find that message pattern in codan.
Comment 10 MedZed CLA 2011-07-14 09:52:59 EDT
(In reply to comment #9)
> It has to be some plug-in. I don't think we check for operator usage at all in
> the current checkers and I can't find that message pattern in codan.

You are correct, my mistake.  It is the plugin I am using for unit testing, CUTE... I'll email the authors with a link to this bug.

Thank you!
Comment 11 Emanuel Graf CLA 2011-07-14 10:02:43 EDT
I created a ticket at cute-test.com