[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Comments in user function variables
From: |
Paul Smith |
Subject: |
Re: Comments in user function variables |
Date: |
Thu, 14 Jul 2011 10:35:16 -0400 |
On Wed, 2011-07-13 at 12:50 -0400, Lane Schwartz wrote:
> On Wed, Jul 13, 2011 at 12:43 PM, Lane Schwartz <address@hidden> 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 <address@hidden> 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