[previous] 0635 [next] [E] Bit-fields in this struct/union have been declared with types other than int, signed int or unsigned int.
Language extensions REFERENCE - ISO:C90-6.5.2.1 Structure and Union Specifiers - Semantics

According to the ISO:C Standard, a bit-field can only be defined with one of the following types:

Some compilers support bit-fields of other integral types, such as char, short and enum. This is a language extension and is not portable.

Message 0635 is only generated once in any struct or union declaration, regardless of how many non-standard bit-fields it may contain.

For example:


/*PRQA S 2211,2213,3131,3211,3408,3602,3621 ++*/

enum ET {A=0, B=1, C=2, D=3}

struct ST                  /* Message 0635 */
{
   signed int     a:3;     /* OK */
   unsigned int   b:4;     /* OK */
   unsigned char  c:6;     /* Non-portable */
   unsigned short d:5;     /* Non-portable */
   enum ET        e:2;     /* Non-portable */
} F;

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents