aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/CodingGuidelines
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2023-06-14 14:31:45 -0700
committerJunio C Hamano <gitster@pobox.com>2023-06-14 14:44:19 -0700
commitf0b68f0546a44e2bc3a764bd75b3aa4418c01601 (patch)
tree8f2cb302fa97c2cd4741f416fb1f4b49ed260372 /Documentation/CodingGuidelines
parentfe86abd7511a9a6862d5706c6fa1d9b57a63ba09 (diff)
downloadgit-f0b68f0546a44e2bc3a764bd75b3aa4418c01601.tar.gz
CodingGuidelines: use octal escapes, not hex
Extend the shell-scripting section of CodingGuidelines to suggest octal escape sequences (e.g. "\302\242") over hexadecimal (e.g. "\xc2\xa2") since the latter can be a source of portability problems. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 003393ed16..39ef53c237 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: