Skip to content

Commit 9097ff7

Browse files
committed
Clarified "new"
1 parent cf304b2 commit 9097ff7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

docs/DeveloperResources/SquidCodingGuidelines.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The increased performance cost of accessing an object through a function
8383
wrapper (as opposed to direct access to a global object) is _not_ a valid
8484
excuse for avoiding a global.
8585

86-
This rule applies to all objects that are (or may become) susceptible to
86+
This rule applies to all new objects that are (or may become) susceptible to
8787
initialization order problems, including globals in the global namespace,
8888
namespace-scope globals, and class-scope static members (regardless of their
8989
access modifiers). This rule does not apply to function-scoped variables.
@@ -92,6 +92,13 @@ This rule *does* apply to would-be globals of built-in/intrinsic types because
9292
they may be subject to similar [initialization
9393
problems](https://isocpp.org/wiki/faq/ctors#static-init-order-on-intrinsics).
9494

95+
This rule does not apply to existing globals. The global prior existence is
96+
determined by its name. For example, changing the type of an existing global
97+
does not automatically subject that global to this rule, especially if many
98+
users of that global remain unchanged. A dedicated pull request may propose to
99+
convert an existing global if the authors think that the benefits of the
100+
conversion outweigh its negative side effects, of course.
101+
95102
To avoid [deinitialization order
96103
problems](https://isocpp.org/wiki/faq/ctors#construct-on-first-use-v2), the
97104
wrapper function must dynamically allocate the would-be global to prevent its

0 commit comments

Comments
 (0)