From 8a98529945e78395036f0c1f5e60a53755aaa411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Joly?= Date: Mon, 25 Nov 2024 23:13:45 +0100 Subject: [PATCH] CPP-5889 S1820 Explain that several consecutive bit fields only count as one --- rules/S1820/cfamily/rule.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rules/S1820/cfamily/rule.adoc b/rules/S1820/cfamily/rule.adoc index c40de3dafa9..61aefd1344f 100644 --- a/rules/S1820/cfamily/rule.adoc +++ b/rules/S1820/cfamily/rule.adoc @@ -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[] '''