2

I am using ARM Eclispe for DS-5 environment to maintain and build a command-line (makefile based) project. Using the Eclipse's Indexer to analyze the code for intelligent browsing and editing, it looks like it does not recognize the underlying ARM C compiler 5 predefined macros. For example, if I have in my code:

#warning "XXXXXXXX Im here 1 XXXXXXX"
#ifdef __arm__
#warning "XXXXXXXX Im here 2 XXXXXXX"
#endif

then when compiling the module I see the first and second warnings (the compiler is aware of its own __arm__ macro, of-course). However, in the editor, the code in the #ifdef block is grayed out. Consequently, I have hundreds of false error indications in the Problems view.

How can I make the environment aware of the compiler built-in settings?

* Using ARM DS-5 version 5.20, and armcc version 5.05

Community
  • 1
  • 1
ysap
  • 7,723
  • 7
  • 59
  • 122

1 Answers1

2

You can set Eclipse C/C++ Project properties: Preprocessor Include Paths, Macros. Adding macros or preprocessor file helps to understand the compiler predefines/macros to eclipse.

Note that the entries could be set also on an individual resource, such as file or folder. Open file or folder properties to inspect resource-specific entries. The entries on a folder or a project will apply to all subfolders and C/C++ files under it - unless overridden on a lower level.

for more information you can check this link Setting Up Include Paths and Macros for C/C++ Indexer

Vicky
  • 59
  • 3
  • 10
  • Thanks. This is what I ended up doing back then. I also reported back to ARM and I think at least some of them were fixed in later revisions. However, this reply does not directly, or fully, answers my question. It will only solve the problem for some macros we are aware of, and those may change (as the move from GCC-based to CLANG-based compiler in Toolchain 6 shows us). – ysap May 31 '17 at 13:06