From 1d5c3f2deaa4b795054f4a4ba28487410048b4c6 Mon Sep 17 00:00:00 2001 From: Thomas Harrison Date: Sat, 12 Sep 2026 15:47:12 -0400 Subject: [PATCH] Add section to code style guide for static functions --- design/style_guide/code.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/design/style_guide/code.md b/design/style_guide/code.md index 60aae6d..7f5221c 100644 --- a/design/style_guide/code.md +++ b/design/style_guide/code.md @@ -3,6 +3,7 @@ \[ [Header Guards](#header-guards) \] \[ [Function Names](#function-names) \] +\[ [Static Functions](#static-functions) \] \[ [Global Variables](#global-variables) \] \[ [Memory Ownership](#memory-ownership) \] @@ -38,6 +39,12 @@ All C++ code or C code outside src/ should use `#pragma once` Function names should include the module (ie. path) as a prefix using snake case. +## Static Functions + +Static functions should be declared (forward declared) at the top of a C file, +below includes and file-level variables, and defined below all non-static +(externally visible) functions in the file. + ## Global Variables Global variables should not be shared between files, but for several systems it