Skip to content

Commit

Permalink
CPP-5889 S1820 Explain that several consecutive bit fields only count…
Browse files Browse the repository at this point in the history
… as one
loic-joly-sonarsource authored Nov 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 0eae539 commit 8a98529
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rules/S1820/cfamily/rule.adoc
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ A structure, such as a ``++struct++``, ``++union++`` or ``++class++`` that grows

Above a specific threshold, it is strongly advised to refactor the structure into smaller ones that focus on well defined topics.

When computing the number of fields in a structure, consecutive bit-fields are counted as a single field: Bit-fields are commonly used to map external definitions, and the associated complexity only reflects this external system's intrinsic complexity.

ifdef::env-github,rspecator-view[]

'''

0 comments on commit 8a98529

Please sign in to comment.