bug-make
[Top][All Lists]
Advanced

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

whitespaces preceding backslash sometimes removed in POSIX mode


From: Arkadiusz Drabczyk
Subject: whitespaces preceding backslash sometimes removed in POSIX mode
Date: Sun, 5 Mar 2023 23:09:01 +0100

In the manual it says:

"If the @code{.POSIX} special target is defined then backslash/newline
handling is modified slightly to conform to POSIX.2: first, whitespace
preceding a backslash is not removed and second, consecutive
backslash/newlines are not condensed."

but I cannot reproduce it with this example makefile:

.POSIX:

var = one          \
        two          \
        three          \
        four

define var1
a          \
b          \
c
endef

all:
        echo ${var}
        echo ${var1}

Output:

$ make
echo one two three four
one two three four
echo a           b           c
a b c

If I read the manual correctly whitespaces between all words should be
preserved in expansion of var too but they are not. This is how bmake
behaves for example, output of `echo ${var}' would be:

echo one           two           three           four
one two three four

For the record, I saw this
https://savannah.gnu.org/bugs/index.php?16670. Is my understanding
correct?

BTW, in make/make/src/misc.c it says:

    In POSIX, each backslash/newline and is replaced by a space.  */

I believe some words are missing in this sentence?

-- 
Arkadiusz Drabczyk <arkadiusz@drabczyk.org>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]