[PATCH 1/8] CodingGuidelines: instruct to name arrays in singular
- From
Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
- Date
- Feb 18, 2026, 21:08 UTC
- Message-ID
- <20260218211845.96009-2-lucasseikioshiro@gmail.com>
- In-Reply-To
- <20260218211845.96009-1-lucasseikioshiro@gmail.com>
Arrays should be named in the singular form, ensuring that when accessing an element within an array (e.g. dog[0]) it's clear that we're referring to an element instead of a collection.
Add a new rule to CodingGuidelines asking for arrays to be named in singular instead of plural.
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> --- Documentation/CodingGuidelines | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index df72fe0177..0158c57277 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -656,6 +656,14 @@ For C programs: unsigned other_field:1; unsigned field_with_longer_name:1; + - Array names should be named in the singular form. E.g.: + + char *dog[] = ...; + + and not: + + char *dogs[] = ...; + For Perl programs: - Most of the C guidelines above apply.
-- 2.50.1 (Apple Git-155)