aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/CodingGuidelines
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-06-22 16:29:07 -0700
committerJunio C Hamano <gitster@pobox.com>2023-06-22 16:29:07 -0700
commit5fd4e2f6d106b1f65b69fdd11172d6d53f5dfce6 (patch)
treebf4018651b5fa687d51a9ea331f2c9b0c0b197b6 /Documentation/CodingGuidelines
parente0e8a2dfa05d66562688804ec38939d8bb56a8fd (diff)
parentf0b68f0546a44e2bc3a764bd75b3aa4418c01601 (diff)
downloadgit-5fd4e2f6d106b1f65b69fdd11172d6d53f5dfce6.tar.gz
Merge branch 'jt/doc-use-octal-with-printf'
Suggest to refrain from using hex literals that are non-portable when writing printf(1) format strings. * jt/doc-use-octal-with-printf: CodingGuidelines: use octal escapes, not hex
Diffstat (limited to 'Documentation/CodingGuidelines')
-rw-r--r--Documentation/CodingGuidelines4
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 1f3290f173..ad0e1905a5 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -188,6 +188,10 @@ For shell scripts specifically (not exhaustive):
hopefully nobody starts using "local" before they are reimplemented
in C ;-)
+ - Use octal escape sequences (e.g. "\302\242"), not hexadecimal (e.g.
+ "\xc2\xa2") in printf format strings, since hexadecimal escape
+ sequences are not portable.
+
For C programs: