Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It is implementation-defined whether the specifier int designates the same type as signed int or the same type as unsigned int for bit-fields. According to the C Standard [ISO/IEC 9899:2011], C integer promotions also require that "if an int can represent all values of the original type (as restricted by the width, for a bit-field), the value is converted to an int; otherwise, it is converted to an unsigned int."

...

This noncompliant code depends on implementation-defined behavior. It prints either -1 or 255, depending on whether a plain int bit-field is signed or unsigned.

...

Tool

Version

Checker

Description

Compass/ROSE

 

 

 

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.INT12

Fully implemented

LDRA tool suite

Include Page
LDRA_V
LDRA_V

73 S

Fully implemented

PRQA QA-C
Include Page
PRQA_V
PRQA_V
0634 (I)Fully implemented

...

Bibliography

[ISO/IEC 9899:2011]Section 6.3.1.1, "Boolean, Characters, and Integers"

...