Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CODAN detect in source code(CODAN detect in source code)
CODAN detect in source code [message #958806] Fri, 26 October 2012 08:22 Go to next message
Han Hoekstra is currently offline Han HoekstraFriend
Messages: 5
Registered: July 2009
Location: The Netherlands
Junior Member
Hello,

Is it possible to detect if CODAN is analysing my C/C++ source code and set some defines for this case.
The reason I ask this is because I am using the avr-gcc compiler and I have to supply the processor type to the compiler, which sets a number of defines for the processor selected and based on those defines, the required include files are 'enabled'. But because CODAN does not know about this, I need to manually set the defines the compiler does in order for CODAN to be abled to find all processor specific 'things', otherwise it complains about a great number of 'things' it can not find.

Thanks in advance,
Han
Re: CODAN detect in source code [message #962632 is a reply to message #958806] Mon, 29 October 2012 07:58 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
You can set/add defines in Project Properties->C/C++ General->Paths and Symbols

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: CODAN detect in source code [message #962866 is a reply to message #962632] Mon, 29 October 2012 11:42 Go to previous messageGo to next message
Han Hoekstra is currently offline Han HoekstraFriend
Messages: 5
Registered: July 2009
Location: The Netherlands
Junior Member
Yes, I know. But I need to set the defines only when I use the Code Analysis, not when I compile the project, because the compiler does this automatically when I specify the processor type on the command-line (which is required).
So I don't want a permanent define, I want it only when Code Analysis is looking at the source code.

So I want something like this:

#ifdef CODAN_IS_RUNNING
#define PROCESSOR_TYPE
#endif

So when Code Analysis is not running, there is to conflict between this define action and the one the compiler itself is doing.
Re: CODAN detect in source code [message #962903 is a reply to message #962866] Mon, 29 October 2012 12:14 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Han Hoekstra wrote on Mon, 29 October 2012 12:42
Yes, I know. But I need to set the defines only when I use the Code Analysis, not when I compile the project, because the compiler does this automatically when I specify the processor type on the command-line (which is required).
So I don't want a permanent define, I want it only when Code Analysis is looking at the source code.

So I want something like this:

#ifdef CODAN_IS_RUNNING
#define PROCESSOR_TYPE
#endif

So when Code Analysis is not running, there is to conflict between this define action and the one the compiler itself is doing.

DEFINES set in Project Properties->C/C++ General->Paths and Symbols are not used by the compiler. These symbols are used for the Eclipse indexer. And CODAN uses this index.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: CODAN detect in source code [message #962938 is a reply to message #962903] Mon, 29 October 2012 12:53 Go to previous message
Han Hoekstra is currently offline Han HoekstraFriend
Messages: 5
Registered: July 2009
Location: The Netherlands
Junior Member
Ok.. Sorry my mistake, I did not know this...
I will give it a try....
Previous Topic:Opengl (glut) window only shows in debugger
Next Topic:CODAN problems "semantic error"
Goto Forum:
  


Current Time: Fri Mar 29 06:54:22 GMT 2024

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

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

Back to the top