Re: [PATCH] CodingGuidelines: use octal escapes, not hex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:

> So, for the commit message, perhaps simply:
>
>     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.
>
> As for the change to CodingGuidelines, this would probably be sufficient:
>
>     Use octal escape sequences (e.g. "\302\242"), not hexadecimal
>     (e.g. "\xc2\xa2"), since the latter is not portable across some
>     commands, such as `printf`, `sed`, `tr`, etc.

I'd prefer singling out `printf`, actually, and not talking about
"across some commands".

As I said in a separate message, we certainly do *not* want to rely
on `echo` interpreting bs-escaped octal sequences without '-e', even
though it may be expected on a POSIX systems, because it is not
portable across systems our users commonly encounter.

And `printf` has been what we chose to turn bs-escaped octal
sequence into binary.  I'd prefer not having to even worry about
`sed`, `tr`, etc. behaving differently and not allowing to expect
these other commands to be usable for turning bs-escaped octal
sequence into binary would be one way to achieve that goal.

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux