Question for a warning-message by ICC12V7 [ MC912DG128A ]

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

Question for a warning-message by ICC12V7 [ MC912DG128A ]

1,388 Views
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!
Labels (1)
0 Kudos
2 Replies

354 Views
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 Kudos

354 Views
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 Kudos