Tue 15 Mar 2016 03:29:11 PM UTC, comment #3:
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.
|