bug-make
[Top][All Lists]
Advanced

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

[bug #46995] Within 'define' newline is treated as non whitespace


From: Brian Vandenberg
Subject: [bug #46995] Within 'define' newline is treated as non whitespace
Date: Tue, 15 Mar 2016 15:29:11 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #3, bug #46995 (project make):

My apologies for the double-post.  I responded to the mailing list and that
didn't add it to the bug history.


> So I understand that the problem actually is that
> foreach adds whitespace into variable name.
>
>   $(foreach var , $(LIST), do something with $(var ))
>
> while in contrast for example 'call' knows to strip
> whitespace from a var name so this:
>
>   $(call var ,$(ARG))
>
> will actually invoke $(var) and not $(var ).

Yes, that's the jist of it.

> Don't think I can change the bug topic.
> Is that a known issue with an already open bug?

I don't know of one, but this is probably sufficient.

I can't think of a valid situation where someone would want leading/trailing
whitespace as part of a variable name, so it's probably safe to just call
strip( gmk_expand( argv[0] ) ) inside the C function backing $(foreach) and
have done with it.

It would still allow the temporary variable to use whitespace between
non-whitespace characters, and that seems like the most obscure case that
should be supported.

For clarity: this can be reproduced /without/ the define like so:

> $(foreach variable_name 
> , list of values 
> , expression 
> )

In that case the name of the variable has a space + newline at the end.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46995>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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