0

I received a big embedded codebase that I have to get comfortable with. I started using Eclipse for C/C++ Developers (Oxygen release 4.7.0) a couple days ago.

I am getting the following types of false error (the code compiles with the prehistoric compiler Softune Workbench):

Eclipse thinks *__far* is a type

This line of code intends to define a pointer named wRecData of type __far result_data_headerW. As far as I know __far keyword is used to access the external ram here. Although Eclipse can't resolve __far (this is why it is underlined red) it still thinks it is a type and result_data_headerW is the name of a local variable and the rest of the line is garbage.

How could I make Eclipse recognize that __far is part of the type and not the type itself?

wp78de
  • 18,207
  • 7
  • 43
  • 71
Greenberet
  • 490
  • 1
  • 5
  • 18
  • This may help: https://stackoverflow.com/questions/24398910/how-to-color-c11s-new-keywords-final-and-override-in-eclipse. Other than that though I guess Eclipse would need a related lexer and parser – Toby Aug 11 '17 at 10:37
  • 1
    It is possible to do this, but a lot of work: http://eclipse.1072660.n5.nabble.com/How-to-add-Keyword-to-CDT-Parser-td166002.html – Toby Aug 11 '17 at 10:42
  • @Toby Sorry but what does this have to do with syntax _coloring_? I think this is an issue of syntax _recognizing_. – Greenberet Aug 11 '17 at 10:45
  • My bad, ignore the first link! – Toby Aug 11 '17 at 10:53

1 Answers1

1

Instead of having Eclipse recognize __far it's probably easier to ignore it.

The Adding Include paths and symbols in Managed Build System section of the documentation documents how to define symbols. If you define __far with an empty value, Eclipse should ignore it.

D Krueger
  • 2,446
  • 15
  • 12