[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug? $(warning)/$(error) evaluated from inside a comment in a 'defin
From: |
Sam Ravnborg |
Subject: |
Re: bug? $(warning)/$(error) evaluated from inside a comment in a 'define'? |
Date: |
Wed, 20 Jun 2007 12:37:38 +0200 |
User-agent: |
Mutt/1.4.2.1i |
On Tue, Jun 19, 2007 at 08:50:32PM +0200, Stephan Beal wrote:
> Hi, Makers!
>
> i just discovered a Make behaviour which really surprises me. While that
> in itself is nothing new ;), this one certainly violates the principal
> of least astonishment:
>
> When a $(warning) or $(error) is inside a 'define', it is evaluated even
> if it is part of a comment. A demonstration:
>
> address@hidden:~/cvs/www.t5$ make --version
> GNU Make 3.81
> ...
>
> Input file to reproduce problem:
> #!/usr/bin/make -f
> ##################################################
> default: all
> define bogo
> # $(warning this should not be evaluated here: (bogo $(1)))
> abc := $(1)
> endef
On the other hand I would have been suprised if make supported having comments
between define/endef.
So in several cases I have used define/endef to avoid the need to quote "#".
Or in other words if "#" suddenly becomes a comment inside define/endef some
Makefile's will break.
Sam