Bitfield not compliance with MISRA 2012

Options
Potoman
Potoman Posts: 1 ✭

Hello,

I try to wrote this struct :

struct toto {

_Bool TEST : 1;

};

But Cpptest tell me that TEST should be a int signed or not following Rule 6.1.

But Misra tell us that it is allowed to use _Bool.

So what's wrong ?

Thx.

Comments

  • mstaron
    mstaron Posts: 35 ✭
    Options

    Hi,
    MISRA C:2012 standard defines rule 6.1 differently for C90 and C99 standards. C++test rule MISRAC2012-RULE_6_1-a is compliant with c90, so violations are reported if a bit-field type is different than signed int or unsigned int. Currently there is no rule compliant with c99, but Parasoft might implement this rule in the future.