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
maint
Junio C Hamano 2023-06-22 16:29:07 -07:00
commit 5fd4e2f6d1
1 changed files with 4 additions and 0 deletions

View File

@ -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: