Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Bad character sequence encountered: @
icon5.gif  Bad character sequence encountered: @ [message #512293] Thu, 04 February 2010 15:16 Go to next message
Dirk Wibben is currently offline Dirk Wibben
Messages: 50
Registered: February 2010
Member
Hello,

I'm developing software on an embedded controller.
I want to use special-function-register (SFR) of the microcontroller with a symbolic name, which addresses the SFR by its location:

volatile unsigned char ioP0 @ 0xFFF00;


Now CDT gives me the annotations 'Bad character sequence encountered: @' and 'Syntax error'.

The compiler and linker for that microcontroller handle that code perfectly.

So what have I to do, to either let CDT accept the code or ignoring the part '@ 0xFFF00' (or any number/address)?

Best regards
Dirk


Best regards
Dirk
Re: Bad character sequence encountered: @ [message #515218 is a reply to message #512293] Thu, 18 February 2010 08:49 Go to previous messageGo to next message
Dirk Wibben is currently offline Dirk Wibben
Messages: 50
Registered: February 2010
Member
Anyone . . . any idea ??? Confused

Best regards
Dirk
Re: Bad character sequence encountered: @ [message #516968 is a reply to message #512293] Thu, 25 February 2010 16:05 Go to previous messageGo to next message
Synopsis  is currently offline Synopsis
Messages: 1
Registered: February 2010
Junior Member
just use the proper (ANSI) syntax:

pointers to memory mapped hardware

[Updated on: Thu, 25 February 2010 16:06]

Report message to a moderator

Re: Bad character sequence encountered: @ [message #517077 is a reply to message #512293] Fri, 26 February 2010 06:26 Go to previous messageGo to next message
Dirk Wibben is currently offline Dirk Wibben
Messages: 50
Registered: February 2010
Member
THX for the hint.


Best regards
Dirk
Re: Bad character sequence encountered: @ [message #646726 is a reply to message #512293] Thu, 30 December 2010 14:52 Go to previous messageGo to next message
Tamas Kleiber is currently offline Tamas Kleiber
Messages: 20
Registered: December 2010
Junior Member
Hello everyone, I have a similar problem.

We've just started to use the eclipse IDE with CDT and we encountered the same warning message.

We are using the Cosmic compiler for Freescale micro controllers which uses or defines several special type qualifiers like @dir, @eeprom, @far, @near.

The type qualifier shall be used like this:
@dir volatile char sync;

For example, the @dir qualifier tells the liker, that the sync variable should be put into the direct memory page which can be addressed using 8 bit addresses. I know that sections can be defined with #pragma directives, so there is a workaround for this annoying issue. But, changing all SW modules in all of our actively developed projects would consume so much time and cost effort that this is not a selectable option for us.

I would like to ask for help on how can I extend CDT's parser to detect and parse correctly custom type qualifiers. It is enough for me if someone could tell which files to look for.

Thank you in advance for your kind help.
Re: Bad character sequence encountered: @ [message #690874 is a reply to message #646726] Thu, 30 June 2011 11:03 Go to previous messageGo to next message
Martin is currently offline Martin
Messages: 1
Registered: June 2011
Junior Member
Hello,

We also use the combination of eclipse CDT and cosmic compiler and we are also looking for a solution or workaround for the "Bad character sequence encountered: @" warning issue of eclipse CDT.

@Tamas:
Did you already find a solution for this issue?

kind regards,
Martin
Re: Bad character sequence encountered: @ [message #690968 is a reply to message #690874] Thu, 30 June 2011 13:39 Go to previous messageGo to next message
Tamas Kleiber is currently offline Tamas Kleiber
Messages: 20
Registered: December 2010
Junior Member
Hello Martin,

I found a workaround Smile Add the following definition to a header file which is included by all of your modules.

#ifdef COSMIC_AT
#define _at(n) @##n
#else
#define _at(n)
#endif

Among the compiler options, there is the -d<DEFINE> option. You can add the compiler option -dCOSMIC_AT="FIX_ME" to define the COSMIC_AT symbol at compilation time. This way, eclipse will not be aware of the symbol definition.

In the C files, you can define @tiny, @interrupt,@dir and other such parameters like this:

extern _at(tiny) unsigned char ucVariable1;

or

void _at(interrupt) IsrRoutine(void);

eclipse will see this: extern unsigned char ucVariable1;
your compiler will see this: extern @tiny unsigned char ucVariable1;

This little trick works perfectly for eclipse together with cosmic compiler.

Best regards,
Tamas


Re: Bad character sequence encountered: @ [message #691282 is a reply to message #690968] Fri, 01 July 2011 06:58 Go to previous messageGo to next message
Dirk Wibben is currently offline Dirk Wibben
Messages: 50
Registered: February 2010
Member
Hi Tamas,

THX for the nice idea.

Regards
Dirk


Best regards
Dirk
Re: Bad character sequence encountered: @ [message #693444 is a reply to message #691282] Wed, 06 July 2011 13:40 Go to previous messageGo to next message
Anton Leherbauer is currently offline Anton Leherbauer
Messages: 490
Registered: July 2009
Senior Member
There has been done some optional support to make the parser accept @ in the source code:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237028
You still need to create and register a custom language variant for it, though. It's explained in the bug.

BTW, instead of
#ifdef COSMIC_AT

you could also use
#ifndef __CDT_PARSER__

This macro is only defined by the CDT parser.
HTH
Re: Bad character sequence encountered: @ [message #693460 is a reply to message #693444] Wed, 06 July 2011 14:07 Go to previous message
Dirk Wibben is currently offline Dirk Wibben
Messages: 50
Registered: February 2010
Member
The whole "thing" with extending the language is way too complex for me with my limited java- and eclipse-knowledge Confused

But the hint with '_CDT_PARSER_' is very good Cool

Regards
Dirk


Best regards
Dirk
Previous Topic:Remote C++ project indexer is not working properly
Next Topic:Breakpoint Installation Failes
Goto Forum:
  


Current Time: Tue Sep 16 01:06:56 GMT 2014

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

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