@ symbol wont compile in 10.2

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

@ symbol wont compile in 10.2

ソリューションへジャンプ
986件の閲覧回数
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 ?

 

 

 

ラベル(1)
0 件の賞賛
返信
1 解決策
677件の閲覧回数
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 件の賞賛
返信
7 返答(返信)
677件の閲覧回数
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 件の賞賛
返信
677件の閲覧回数
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 件の賞賛
返信
677件の閲覧回数
michaelsanderse
Contributor I

Thanks, of course that was it.

0 件の賞賛
返信
677件の閲覧回数
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.

677件の閲覧回数
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 件の賞賛
返信
677件の閲覧回数
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.

678件の閲覧回数
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 件の賞賛
返信