Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Bad character sequence encountered: @
icon5.gif  Bad character sequence encountered: @ [message #512293] Thu, 04 February 2010 10:16 Go to next message
Eclipse UserFriend
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
Re: Bad character sequence encountered: @ [message #515218 is a reply to message #512293] Thu, 18 February 2010 03:49 Go to previous messageGo to next message
Eclipse UserFriend
Anyone . . . any idea ??? Confused
Re: Bad character sequence encountered: @ [message #516968 is a reply to message #512293] Thu, 25 February 2010 11:05 Go to previous messageGo to next message
Eclipse UserFriend
just use the proper (ANSI) syntax:

pointers to memory mapped hardware

[Updated on: Thu, 25 February 2010 11:06] by Moderator

Re: Bad character sequence encountered: @ [message #517077 is a reply to message #512293] Fri, 26 February 2010 01:26 Go to previous messageGo to next message
Eclipse UserFriend
THX for the hint.
Re: Bad character sequence encountered: @ [message #646726 is a reply to message #512293] Thu, 30 December 2010 09:52 Go to previous messageGo to next message
Eclipse UserFriend
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 07:03 Go to previous messageGo to next message
Eclipse UserFriend
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 09:39 Go to previous messageGo to next message
Eclipse UserFriend
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 02:58 Go to previous messageGo to next message
Eclipse UserFriend
Hi Tamas,

THX for the nice idea.

Regards
Dirk
Re: Bad character sequence encountered: @ [message #693444 is a reply to message #691282] Wed, 06 July 2011 09:40 Go to previous messageGo to next message
Eclipse UserFriend
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 10:07 Go to previous message
Eclipse UserFriend
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
Previous Topic:Remote C++ project indexer is not working properly
Next Topic:Breakpoint Installation Failes
Goto Forum:
  


Current Time: Sun Oct 19 20:18:52 EDT 2025

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

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

Back to the top