On Wed, 2011-07-13 at 12:50 -0400, Lane Schwartz wrote:
> On Wed, Jul 13, 2011 at 12:43 PM, Lane Schwartz <[email protected]> wrote:
> > I've encountered some unexpected behavior when defining a complex
> > variable that's later accessed using eval or call.
> 
> Here's an example:
> 
> define FOO
> # $(error Here's a line that should be commented out)
> bar baz
> endef
> 
> BAR:=$(call FOO)
> 
> When this code is run, the error function is called, despite the fact
> that it's commented out.

Yes.

> Is this the correct expected behavior? It seems to me that comments
> within such multi-line variable definitions should respected, but
> aren't always.

call simply expands the value it's given.  It doesn't interpret that
expansion as makefile syntax.

So "#" has no special meaning inside that expansion.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email protected]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to