aboutsummaryrefslogtreecommitdiffstats
path: root/.clang-format
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2019-12-06 22:03:02 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2019-12-14 15:53:04 +0900
commitc8f3dea90e38194dae542c5d56e05d30447e58cb (patch)
tree4d5b81e9741caf4f54e7e05bd37a9196c5e35dd1 /.clang-format
parentmkcompile_h: git rid of UTS_TRUNCATE from LINUX_COMPILE_{BY,HOST} (diff)
downloadlinux-dev-c8f3dea90e38194dae542c5d56e05d30447e58cb.tar.xz
linux-dev-c8f3dea90e38194dae542c5d56e05d30447e58cb.zip
mkcompile_h: use printf for LINUX_COMPILE_BY
Commit 858805b336be ("kbuild: add $(BASH) to run scripts with bash-extension") shed light on portability issues. Here is another one. Since commit f07726048d59 ("Fix handling of backlash character in LINUX_COMPILE_BY name"), we must escape a backslash contained in LINUX_COMPILE_BY. This is not working on such distros as Ubuntu. As the POSIX spec [1] says, if any of the operands contain a backslash ( '\' ) character, the results are implementation-defined. The actual shell of /bin/sh could be bash, dash, etc. depending on distros, and the behavior of builtin echo command is different among them. The bash builtin echo, unless -e is given, copies the arguments to stdout without expanding escape sequences (BSD-like behavior). The dash builtin echo, in contrast, adopts System V behavior, which does expand escape sequences without any option given. Even non-builtin /bin/echo behaves differently depending on the system. Due to these variations, echo is considered as a non-portable command. Using printf is the common solution to avoid the portability issue. [1] https://pubs.opengroup.org/onlinepubs/009695399/utilities/echo.html Fixes: 858805b336be ("kbuild: add $(BASH) to run scripts with bash-extension") Reported-by: XXing Wei <xxing.wei@unisoc.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to '.clang-format')
0 files changed, 0 insertions, 0 deletions