Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2023-06-15 00:31:45 +0300
committerJunio C Hamano <gitster@pobox.com>2023-06-15 00:44:19 +0300
commitf0b68f0546a44e2bc3a764bd75b3aa4418c01601 (patch)
tree8f2cb302fa97c2cd4741f416fb1f4b49ed260372 /Documentation
parentfe86abd7511a9a6862d5706c6fa1d9b57a63ba09 (diff)
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')
-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: