On Fri, Dec 24, 2021 at 6:30 PM Humm <hummsmit...@gmail.com> wrote: > That’s the argument I’m making.
Humm, in the following example do you want N and M to expand to different values? If yes, can you please tell us about your use case where such behavior is needed? .POSIX: M=word N=${M:word=a\ b} all:; echo ${N} ${M:word=a\ b} i tested gmake, bmake, sun make and aix make. gmake and bmake both replace the newline with a space and pass 'a b a b' to the shell. sun make fails to find the closing brace and exits with an error message. aix make removes the newline and passes 'a b ab' to the shell. in the following example all:; echo 'a\ b' gmake and sun make both pass 'a\ b' to the shell. bmake passes 'a b' to the shell. aix make passes 'ab' to the shell. i think gnu make's behavior is correct. Otherwise, variable expansion becomes context dependent and who needs that complication? Gnu make manual is quite explicit 5.1.2 says "Variable and function references in recipes have identical syntax and semantics to references elsewhere in the makefile." If we can agree, then i'll file a request to opengroup to explicitly state that this "When an escaped <newline> is found in a command line in a makefile, the command line shall contain the <backslash>, the <newline>, and the next line, except that the first character of the next line shall not be included if it is a <tab>". takes place after variable expansion. regards, Dmitry