C1005: Illegal storage class error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

C1005: Illegal storage class error

跳至解决方案
2,522 次查看
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

 

 


标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,865 次查看
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.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,865 次查看
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 项奖励
回复
1,866 次查看
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.

0 项奖励
回复