NetBSD-Bugs archive

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

bin/49443: Problem in make variable modifiers

>Number:         49443
>Category:       bin
>Synopsis:       Problem in make variable modifiers
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 02 22:15:00 +0000 2014
>Originator:     Michael Grünewald
>Release:        NetBSD 6.1.5
NetBSD 6.1.5 NetBSD 6.1.5 (GENERIC) amd64

The variable modifier :[#] does not behave as documented in
the manual page when used in a Makefile.

Instead of resulting in a variable expanding into the number
of words in that variable (expected) the :[#] causes a syntax
error similar to:

    make: Unclosed substitution for TEST (] missing)

We may guess that the # appearing in the variable modifier
is erroneously interpreted as a comment character.

Quite intererstingly, the following one-liner behaves

    % make TEST='1 2 3' -V '${TEST:[#]}'

cat > <<EOF
TEST=1 2 3
.warning ${TEST:[#]}

make -f


Home | Main Index | Thread Index | Old Index