| CODAN detect in source code [message #958806] |
Fri, 26 October 2012 04:22  |
Han Hoekstra 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 #962903 is a reply to message #962866] |
Mon, 29 October 2012 08:14   |
Axel Mueller Messages: 1827 Registered: July 2009 |
Senior Member |
|
|
Han Hoekstra wrote on Mon, 29 October 2012 12:42Yes, 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.07219 seconds