Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Configuring editor to recognize non standard C syntax eg '__critical'
Configuring editor to recognize non standard C syntax eg '__critical' [message #228963] Tue, 20 January 2009 08:40 Go to next message
Kustaa Nyholm is currently offline Kustaa NyholmFriend
Messages: 14
Registered: July 2009
Junior Member
Hi,

I'm using Eclipse CDT with SDCC (Small Device C Compiler) which requires
me to pester my code with non standard keywords like __data, __code,
__critical etc. The editor/parser in Eclipse wants to flag these as
errors, which is pretty annoying as for example a function marked as
__critical will show up as fully underlined in Eclipse. Not very useful.
Now I'm confident Eclipse can be configure not to do this, but so far I've
not been able to figure out how to do that.
Re: Configuring editor to recognize non standard C syntax eg '__critical' [message #228978 is a reply to message #228963] Tue, 20 January 2009 09:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: subs._nospam_consertum.com

I think you will need to define them as empty macros within a
conditional compile that is only true when indexer is running.

Something like
#ifdef <indexer_running>
#define __crticial
#endif

I'm not sure what the value of <indexer_running> should be...

Kustaa Nyholm wrote:
> Hi,
>
> I'm using Eclipse CDT with SDCC (Small Device C Compiler) which requires
> me to pester my code with non standard keywords like __data, __code,
> __critical etc. The editor/parser in Eclipse wants to flag these as
> errors, which is pretty annoying as for example a function marked as
> __critical will show up as fully underlined in Eclipse. Not very useful.
> Now I'm confident Eclipse can be configure not to do this, but so far
> I've not been able to figure out how to do that.
>


--
Derek
Re: Configuring editor to recognize non standard C syntax eg '__critical' [message #229008 is a reply to message #228963] Tue, 20 January 2009 10:41 Go to previous messageGo to next message
Anton Leherbauer is currently offline Anton LeherbauerFriend
Messages: 490
Registered: July 2009
Senior Member
Kustaa Nyholm wrote:
> Hi,
>
> I'm using Eclipse CDT with SDCC (Small Device C Compiler) which requires
> me to pester my code with non standard keywords like __data, __code,
> __critical etc. The editor/parser in Eclipse wants to flag these as
> errors, which is pretty annoying as for example a function marked as
> __critical will show up as fully underlined in Eclipse. Not very useful.
> Now I'm confident Eclipse can be configure not to do this, but so far
> I've not been able to figure out how to do that.
>

In case of an unmanaged makefile project, the simplest solution is to
add empty macros for the problematic keywords on the Paths and Symbols
properties page.

In case of a managed project, create a header file containing something
like:

#ifdef __CDT_PARSER__
#define __data
#define __code
#define __critical
#endif

and make sure this is included before everything else.

A more involved solution would be to create a new language using
extension point org.eclipse.cdt.core.language.

HTH
--
Anton Leherbauer
Wind River Systems, Austria
CDT Committer - http://www.eclipse.org/cdt
Re: Configuring editor to recognize non standard C syntax - SOLVED [message #229023 is a reply to message #229008] Tue, 20 January 2009 11:16 Go to previous message
Kustaa Nyholm is currently offline Kustaa NyholmFriend
Messages: 14
Registered: July 2009
Junior Member
Thanks Anton,

I'm using a unmanaged Makefile and the solution to put those defines in
the Paths and Symbols page worked perfectly.

This is basically what John suggested and I had considered this solution
but did not know about this page nor about __CDT_PARSER__ symbol, and thus
the parser was too clever when I tried to fool it to think that the
symbols were empty whereas in reality / compile time they were defined.
But using __CDT_PARSES__ or putting them on the Paths and Symbols page
solves that.

Thanks.

br Kusti
Previous Topic:Line terminator preference
Next Topic:Code completion, popup window & mouse pointer position
Goto Forum:
  


Current Time: Sat Apr 27 15:36:17 GMT 2024

Powered by FUDForum. Page generated in 0.02947 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top