Question for a warning-message by ICC12V7 [ MC912DG128A ]

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

Question for a warning-message by ICC12V7 [ MC912DG128A ]

1,881件の閲覧回数
hc12prog
Contributor I
Hello,
 
I use the MC912DG128A and programm with ICC12 V7 from ImageCraft. Now I get the warning-message after compiling from:
Code:
asm(".include 'filename.asm' ");

 
the message called "empty declaration". What does it mean? It is a heavy mistake/warning?
 
Thank you!
ラベル(1)
0 件の賞賛
返信
2 返答(返信)

847件の閲覧回数
kef
Specialist I
It means compiler doesn't see a function and function body you should put your code, asm(""), in. Warning will disappear if you you change you code from something like
 
asm("include filename.asm");
 
void main(void)
{
}
 
to
 
void main(void)
{
asm("include filename.asm");
}
 
 
In ICC you may ignore this warning, filename.asm will be included and should not interact with C code, unless you have something smart in your include file.
 
 
0 件の賞賛
返信

847件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
I really don't know the imagecraft compiler, but I wonder if the semicolon ";" is necessary for the asm directive.
Basically in a C file, outside of a function, a single semicolon is an empty declaration, and already an extension to the ANSI standard, as far as I remember.
So I wonder if you get the same message for a single semicolon and if the compiler accepts the asm directive without with the ; afterwards.

BTW: But could also be kef's explanation, as mentioned, I did not use Imagecraft in the past.

Daniel
0 件の賞賛
返信