Skip to content

Commit 3e96c5f

Browse files
committed
refine RULE-6-1
Use the fact that `resolveTypedefs` is an identity operation with types that have no type alias (typedef).
1 parent 831cf03 commit 3e96c5f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

c/misra/src/rules/RULE-6-1/BitFieldsShallOnlyBeDeclaredWithAnAppropriateType.ql

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ from BitField bitField
2828
where
2929
not isExcluded(bitField,
3030
BitfieldTypesPackage::bitFieldsShallOnlyBeDeclaredWithAnAppropriateTypeQuery()) and
31-
/* A violation would neither an appropriate primitive type nor an appropriate typedef. */
32-
not (
33-
isAppropriatePrimitive(bitField.getType()) or
34-
isAppropriatePrimitive(bitField.getType().resolveTypedefs())
35-
)
31+
/* A violation would neither be an appropriate primitive type nor an appropriate typedef. */
32+
not isAppropriatePrimitive(bitField.getType().resolveTypedefs())
3633
select bitField, "Bit-field " + bitField + " is declared on type " + bitField.getType() + "."

0 commit comments

Comments
 (0)