Thread (6 messages) 6 messages, 3 authors, 2023-06-13
STALE1105d

[PATCH] CodingGuidelines: use octal escapes, not hex

From: Jonathan Tan <hidden>
Date: 2023-06-13 17:30:49
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

Possibly related (same subject, not in this thread)

Hexadecimal escapes in shell scripts are not portable across shells (in
particular, "dash" does not support them). Write in the CodingGuidelines
document that we should be using octal escapes instead.

Signed-off-by: Jonathan Tan <redacted>
---
 Documentation/CodingGuidelines | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 003393ed16..1c54abd7c5 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -188,6 +188,9 @@ 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"), as the latter is not portable.
+
 
 For C programs:
 
-- 
2.41.0.162.gfafddb0af9-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help