RULE-6-1
: Permit bitfields of other integer types, depending on the compiler
#318
Labels
Difficulty-Medium
A false positive or false negative report which is expected to take 1-5 days effort to address
false positive/false negative
An issue related to observed false positives or false negatives.
Impact-Medium
Phase II
user-report
Issue reported by an end user of CodeQL Coding Standards
Affected rules
RULE-6-1
Description
Support for the use of bitfields on integer types outside of
unsigned int
andsigned int
depends on the implementation.gcc
- permits any integer type to be use for bitfields, per https://gcc.gnu.org/onlinedocs/gcc/Structures-unions-enumerations-and-bit-fields-implementation.html.armclang
- "Enumeration types, long and long long (signed and unsigned) are allowed as bitfield types." https://developer.arm.com/documentation/100067/0612/Standard-C-Implementation-Definition/Structures--unions--enumerations--and-bitfieldsclang
- I believe it supports at leastlong
andlong long
, but I cannot find canonical documentation for that. It is alluded to elsewhere, though, e.g. https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2774.htm.qcc
- no information, would need some researchThe text was updated successfully, but these errors were encountered: