@ symbol wont compile in 10.2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

@ symbol wont compile in 10.2

Jump to solution
862 Views
SecondTechCo
Contributor IV


I am working on Codewarrior version 10.2.

 

I am using the example of AN3748 and am trying to compile.  It wont import directly so I had to bring in the files manually.  I cant get this line to compile

 

const byte NVPROT_INIT @0x0000040D  = 0xFB;

 

It keeps givng me an error "bad character sequence encountered"

Can someone tell me why ?

 

 

 

Labels (1)
0 Kudos
1 Solution
553 Views
SecondTechCo
Contributor IV

Thanks.  I tried your suggestions without any luck.  So I reexamined the code and found my statement was within a function block.  I moved it outside of the function block and it worked fine.  Thank you for the help.  Your trying it and letting me know it worked fine really helped.

View solution in original post

0 Kudos
7 Replies
553 Views
michaelsanderse
Contributor I

Hi William.

Can you please help us. We are trying AN3748 in CW10, but are getting errors. See

https://community.nxp.com/message/317644

0 Kudos
553 Views
SecondTechCo
Contributor IV

try usr_entry_c.obj (.text)

For my file, I called it bootloader.c and here was the syntax for the lcf file

bootloader_c.obj (.text)

0 Kudos
553 Views
michaelsanderse
Contributor I

Thanks, of course that was it.

0 Kudos
553 Views
BlackNight
NXP Employee
NXP Employee

Which CPU/architecture are you using?

Depending on your compiler, the @ probably is not supported (it is not part of ANSI C).

Or you have an option set to compile in strict ANSI mode (something like -Ansi).

The message indicates that the line might have a bad ASCII character, but I think this is rather unlikely.

Hope this helps.

553 Views
SecondTechCo
Contributor IV

MCF51.

This is sample code from freescale that I am compiling straight from the the referenced article so I would assume the at sign is good but that is my basic question.   The example was done using the preeclipse compilers though.

0 Kudos
553 Views
BlackNight
NXP Employee
NXP Employee

I tried this with my MCF51CN128 and CodeWarrior:

const int b@0x123;

and this works fine.

That kind of syntax is supported AFAIK in the pre-eclipse compiler too.

So I still think that this is because of your option settings: could you check that you do *not* have things set like

ANSI Strict: -strict on

ANSI keywords only: -stdkeywords on

in the compiler language settings?


Apart of that: have you 'byte' declared? Maybe try to change your line of code to

const unsigned char NVPROT_INIT @0x0000040D  = 0xFB;


Hope this helps.

554 Views
SecondTechCo
Contributor IV

Thanks.  I tried your suggestions without any luck.  So I reexamined the code and found my statement was within a function block.  I moved it outside of the function block and it worked fine.  Thank you for the help.  Your trying it and letting me know it worked fine really helped.

0 Kudos