1

I have project that was created in another IDE that is build for a specific microcontroler. In the code faris used quite often and it is comprehended by the IDE and compiler.

I would like to use eclipse to edit the code, because it is more convinient to use. But it generates a lot of warnings and errors in the editor because he can not resolve the far.

I could create a macro #define far, but I would have to remove it when I want to compile the code. I don't compile with eclipse, because getting the compiler to work there is cumbersome and might introduce problems.

So is there a possibility that eclipse itself can handle the far for its syntax check?

Kami Kaze
  • 2,069
  • 15
  • 27

2 Answers2

1

Another approach that involves modifying your code rather than the project settings would be:

#ifdef __CDT_PARSER__
#define far
#endif

__CDT_PARSER__ is a macro that is automatically defined by CDT's parser when it processes your code, but not by any compiler.

HighCommander4
  • 50,428
  • 24
  • 122
  • 194
  • This is a viable solution. I still prefer not to do so, because it will be visible to other people working with the project and might confuse them. (Or I would have least be careful not to merge it). It would have the advantage that it works on every PC without setup. – Kami Kaze Mar 23 '18 at 08:09
0

After I searched a bit more I found an answer here: https://www.eclipse.org/forums/index.php/t/72375/

Go to the menu:

Project -> Properties -> C/C++ General -> Path and Symbols -> Symbols

and add a Symbol called far with the value /* */.

I just left the value empty and it worked.

Kami Kaze
  • 2,069
  • 15
  • 27