Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341089

Summary: Codan does not handle missing functions in macros correctly
Product: [Tools] CDT Reporter: Thomas Kallenberg <thomas>
Component: cdt-codanAssignee: Emanuel Graf <emanuel>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, emanuel, mschwab
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch to support correct reporting of missing functions in macro
none
Patch for clean marker message in case of macros emanuel: iplog+

Description Thomas Kallenberg CLA 2011-03-28 08:18:57 EDT
Created attachment 191996 [details]
patch to support correct reporting of missing functions in macro

Hi, 

Codan does not return the correct name and position of a missing function, if the call is made from a macro like:

#define MACRO(f) f()

int function()
{
 MACRO(doesnotexist());
}

Codan would report the whole line as a problem. However, the correct information is needed to create a non existing function.

Thank you very much for looking into this.

cheers, Thomas
Comment 1 Martin Schwab CLA 2011-04-05 11:31:44 EDT
Created attachment 192569 [details]
Patch for clean marker message in case of macros

We've cleaned up the patch, made it work with current HEAD, tested it with Codan's AutomatedIntegrationSuite

Premium advantages:
* add only 7 lines of code to your code base
* These 7 lines are compensated with 10 lines of tests
* You can only win if you have a look at this patch :-)
Comment 3 Emanuel Graf CLA 2011-04-06 04:33:08 EDT
Fixed in HEAD >20110406