Why is this an issue?
This is a draft version of a MISRA C++ 202x rule proposed for public review.
MISRA Rule 9.2.3
Analysis Type: Decidable,Single Translation Unit
A single-bit signed bit-field is unlikely to behave in a useful way and its presence is likely to indicate an error.
Note: anonymous signed bit-fields of any length are allowed as they cannot be accessed.
signed int a : 1; // Non-compliant
signed int : 1; // Rule does not apply
signed int : 0; // Rule does not apply
signed int b : 2; // Compliant
int c : 1; // Non-compliant
Copyright The MISRA Consortium Limited © 2023
S2216 targets the same defect as this rule but for a non-mission-critical context.