CodeWarrior IDE Version 4.2.6.895
HCS12A256
Hi all,
i have a little problem with the Compiler. I am on a project to create a Bootloader running in RAM for reprogramming flash memory. The -Pic –PicRTS options are activated for position independent code.
The Problem is that I receive the Compiler Error “Illegal storage class” for this definition in a Header File:
typedef struct
{
unsigned char data[0x800];
…..
…..
} STR_FPGA_MEM;
I can’t see the problem. Could somebody help me?
Thanks
Daniel
Solved! Go to Solution.
I, too, have gotten bitten by this one. One would think that if the parsed line is unterminated by a semicolon, and the end of file is reached, an error for the offending line should be generated.
Who in their right mind would continue a C statement ACROSS files?!
Well, it's legal in ANSI C.
And there may be some uses for it when including the same file multiple times with different defines.
I agree that normally you would not do this for a statement, but for example it could make sense to do it for initialization data.
You can propose this as feature request using the support system to at least issue a warning when a statement crosses multiple files.
Daniel
Didn't you rather get two errors? First "illegal storage class" and then "missing semicolon".
Also, if you haven't gotten burned by strange missing semicolon errors over and over yet, don't worry. This is an initation rite all C programmers have to go through during their first 5 years or so, until they eventually learn to type out semicolons in their sleep.
Truer words, never spoken, Lundin.
Wow, this got me too! Even with the hint of it being a prototype declaration, it still took me a while to find.