From a870470cbca3f102233daa7a9c14733261d6a13d Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Thu, 5 May 2022 14:36:15 +0200 Subject: pkg/kconfig: accept \n as valid within quoted string linux-next contains "Kconfig: Add option for asm goto w/ tied outputs to workaround clang-13 bug", which added this elaborate config variable to init/Kconfig: | config CC_HAS_ASM_GOTO_TIED_OUTPUT | depends on CC_HAS_ASM_GOTO_OUTPUT | # Detect buggy gcc and clang, fixed in gcc-11 clang-14. | def_bool $(success,echo 'int foo(int *x) { asm goto (".long (%l[bar]) - .\n": "+m"(*x) ::: bar); return *x; bar: return 0; }' | $CC -x c - -c -o /dev/null) The current validation in parser.go will complain with "bad quoted character", because of the '\n' in the quoted string. Fix it by allowing '\n'. --- pkg/kconfig/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/kconfig/parser.go b/pkg/kconfig/parser.go index 5fe9bed09..60bfc54a1 100644 --- a/pkg/kconfig/parser.go +++ b/pkg/kconfig/parser.go @@ -142,7 +142,7 @@ func (p *parser) QuotedString() string { if ch == '\\' { ch = p.char() switch ch { - case '\'', '"', '\\': + case '\'', '"', '\\', 'n': str = append(str, ch) default: p.failf("bad quoted character") -- cgit mrf-deployment