General
cancel
Showing results for 
Search instead for 
Did you mean: 

nonstandard type for a bit field warning

C. Andy Wagner
Occasional Visitor

nonstandard type for a bit field warning

I am compiling a C application on an HP Unix 11.23 platform using the C99 compiler. I am receiving the following three warning message from the /usr/include/sys/_mbstate_t.h include file.

"/usr/include/sys/_mbstate_t.h", line 11: warning #2230-D: nonstandard type
for a bit field
unsigned char __parse_size:3;
^
"/usr/include/sys/_mbstate_t.h", line 12: warning #2230-D: nonstandard type
for a bit field
unsigned char __dummy:4;
^
"/usr/include/sys/_mbstate_t.h", line 13: warning #2230-D: nonstandard type
for a bit field
unsigned char __shift_state:1;

I understand that the c99 compiler warns the user of the use of "unsigned char". However, this is in a system include file. Is there a compiler option that will tell the c99 compiler to accept "unsigned char"? I don't want to surpress warning messages and I really don't like to ignore warning messages. Any help will be greatly appreciated.
1 REPLY
Dennis Handly
Acclaimed Contributor

Re: nonstandard type for a bit field warning

What version of aC++ are you using?
The only way you can get that warning on system include files is if you are illegally including the default include path, -I/usr/include. Remove it.

>Is there a compiler option that will tell the c99 compiler to accept "unsigned char"?

The compiler does accept it. By using c99 instead of "cc -AC99", you are asking to get that warning.
You can suppress warning 2230 with +W2230.