Search code examples
ceclipseeclipse-cdtpic

How to teach eclipse custom pre-processor directives?


I'm trying to use eclipse CDT IDE for Microchip PIC development using the CCS C Compiler. Primarily I want to use eclipse CDT as an editor, so I created a makefile project. The makefile just invokes the compiler as makefiles do. This works just fine.

CCS C Compiler uses some non-Standard pre-processor directives like #device, #fuses, #asm, #org etc. The editor adds yellow curly underlines and a question mark to this directives with the hint :"invalid preprocessor directive". Is there anything I can do, to teach eclipse these custom pre-processor directives? As I said compiling by makefile works fine but the curly underlines bother me.

Thanks for helping.


Solution

  • Using the #pragma directive solves the issue. Because the directives I am using are highly compiler related, the #pragma is the way to go. Not what I originally wanted, but it works. No warnings and curly underlines are shown anymore.

          #pragma device 16F688
          #pragma fuses INTRC_IO,WDT,PUT,MCLR, ...
    

    instead of

          #device 16F688
          #fuses INTRC_IO,WDT,PUT,MCLR, ...