C1005: Illegal storage class error

cancel
Showing results for 
Search instead for 
Did you mean: 

C1005: Illegal storage class error

Jump to solution
863 Views
v_dave
Contributor IV

Hello All,

 

OK, all was going as well as can be expected with my project when something changed in my project settings because suddenly I started getting the C1005 errors on compile.  I had used this specific piece of code in many, many projects and never had this issue before.

 

#define MAX_QUE_SIZE    48

typedef struct QUE
{
    unsigned char   buffer[MAX_QUE_SIZE];
    unsigned char   head;
    unsigned char   tail;
}que;

 

The last line "}que;" is where the error is being reported.

 

Looking at the very brief description of this error "A declaration contains an illegal storage class." in the documentation means somehow I used a keyword.  I don't see it.

 

Anyone have any ideas what could have changed in my project settings to cause this error to occur? Any ideas on how to fix it?

 

Info:

Win 7

Codewarrior 10.3

HCS08 project (9S08AW60)

 

Thanks,

Dave

 

 


Labels (1)
Tags (2)
0 Kudos
1 Solution
206 Views
v_dave
Contributor IV

Hello,

Thanks the response but I just found the problem.  It is related to a missing semicolon in a completely different .h file.  I found this past posting here:

https://community.freescale.com/message/28495#28495

I started to poke around my different .h files and realized I added a new function and forgot the semicolon.  Been doing this C thing for 15+ years and everytime I have one of these weird errors that costs me hours of time it always turns out to be caused by a simple missing character.

View solution in original post

0 Kudos
2 Replies
206 Views
BlackNight
NXP Employee
NXP Employee

Hi Dave,

I would produce a preprocessor listing and inspect what the compiler is seeing. To create the preprocessor listing, right click on the source file in the editor and select that menu.

I suspect you have somewhere a macro set to something you use in your source/struct.

I hope this helps.

0 Kudos
207 Views
v_dave
Contributor IV

Hello,

Thanks the response but I just found the problem.  It is related to a missing semicolon in a completely different .h file.  I found this past posting here:

https://community.freescale.com/message/28495#28495

I started to poke around my different .h files and realized I added a new function and forgot the semicolon.  Been doing this C thing for 15+ years and everytime I have one of these weird errors that costs me hours of time it always turns out to be caused by a simple missing character.

View solution in original post

0 Kudos