Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to get warnings for undeclared functions
icon5.gif  How to get warnings for undeclared functions [message #1030658] Sun, 31 March 2013 14:34 Go to next message
Sam Edjanko is currently offline Sam EdjankoFriend
Messages: 3
Registered: June 2011
Junior Member
Hi All

I don't get it managed that eclipse detects and marks functions that have not been declared before. This only works with undeclared variables, but not functions. For instance:

int main(void) {
undeclaredFunction("test"); // not market, although never declared
undeclaredVariable = 13; // marked as "symbol unresolved"
return 1;
}

I ticked the field "Function cannot be resolved" in Eclipse / Settings / C C++ / Code Analysis

Does anybody have a hint into the right direction?

Thanks
Sam
Re: How to get warnings for undeclared functions [message #1032271 is a reply to message #1030658] Tue, 02 April 2013 19:53 Go to previous messageGo to next message
Sam Edjanko is currently offline Sam EdjankoFriend
Messages: 3
Registered: June 2011
Junior Member
Interestingly, this works with C++ projects but not with C projects. I'm completely lost.
Re: How to get warnings for undeclared functions [message #1032694 is a reply to message #1032271] Wed, 03 April 2013 10:02 Go to previous message
Klaus km is currently offline Klaus kmFriend
Messages: 142
Registered: November 2011
Senior Member
Hello Sam,

Quote:
Interestingly, this works with C++ projects but not with C projects. I'm completely lost.


sadly the Code Analysis function (CODAN) is not yet documented, but I guess that it distinguishes between C and C++, because they languages are different.
See: http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B

In C implicit function declaration are possible (but bad style) but in C++ this is not allowed.

I think that CODAN should report an Error for C++ (what it does) and a Warning for C (it does not).

Please check Bugzilla, maybe there is already a related bug entry. If not, you could add one...

regards,
Klaus


Previous Topic:GDB fails on simple linked list data type
Next Topic:Jni application error Javaw.exe -Application error?
Goto Forum:
  


Current Time: Fri Apr 26 05:38:20 GMT 2024

Powered by FUDForum. Page generated in 0.02891 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top