Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Bitfield not compliance with MISRA 2012

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

    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.