GCC extension error..

Hi All,
I have declared the structure like below
1
2
3
4
5
 struct faults_det_ {
                unsigned char rps_no_data       :1;
                unsigned char cfg_rejected      :1;
                unsigned char xdp_pwr_rps       :1;
}


while compiling the following errors " warning: type of bit-field 'rps_no_data' is a GCC extension" I am getting ie warnings so here warnings treated as erros.. Please any can quickly help how to resolve this issue.

Thanks
Babu
I think this addresses your question:
https://stackoverflow.com/questions/10906238/warning-when-using-bitfield-with-unsigned-char

In C90 you only boolean or integer types were allowed with bitfields (else undefined behavior results), but gcc -pedantic still gives a warning even in C99 mode where implementation-defined types are allowed.
Topic archived. No new replies allowed.