[previous] 0348 [next] Using a bit-field.
K+R compatibility

A bit-field is being defined. Bit-fields were not supported in early versions of the C language.

Be aware that message 0348 is only generated when the "-k+r b" option is enabled. Messages 0348 and 3621 are functionally equivalent except that message 3621 is only ever generated once in the declaration of a struct or union type. When the "-k+r b" option is enabled, message 3621 is no longer generated.

For example:


/*PRQA S 2017,2213,3131,3211,3408 ++*/
/*****************************
 * OPTIONS: -k+r b
 ****************************/

struct ST
{
    unsigned int a;                     /*              */
    unsigned int b:3;                   /* Message 0348 */
    unsigned int c:5;                   /* Message 0348 */
};

struct ST stx = {0};

See also:

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