bug-make
[Top][All Lists]
Advanced

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

Re: Excessive $(strip)


From: J.T. Conklin
Subject: Re: Excessive $(strip)
Date: Thu, 03 Apr 2014 13:33:21 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, berkeley-unix)

"Gisle Vanem" <address@hidden> writes:

> "Martin Dorey" <address@hidden> wrote:
>
>>> this also removes the newlines.
>>...
>>> IMHO make 4.x has a too strict definition of white-space.
>>
>> http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap07.html 
>> sayeth:
>>
>> "In the POSIX locale, at a minimum, the <space>, <form-feed>,
>> <newline>, <carriage-return>, <tab>, and <vertical-tab> shall be
>> included."
>
> Then the make manual is a bit sloppy in the use of "whitespace".

I'd say that make itself is sloppy wrt whitespace, where sometimes
newlines are considered to be whitespace, othertimes not.

For example, as you reported, gmake's $(strip ...) function treats
newlines as whitespace.  But the "word" family of functions do not.

    define x
    foo
    bar
    endef

    all:
            echo $(words $(x))
            echo $(words $(strip $(x)))

Given a choice, I'd prefer the word functions treat newlines as
whitespace.

    --jtc

-- 
J.T. Conklin



reply via email to

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