bug-make
[Top][All Lists]
Advanced

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

bug? $(warning)/$(error) evaluated from inside a comment in a 'define'?


From: Stephan Beal
Subject: bug? $(warning)/$(error) evaluated from inside a comment in a 'define'?
Date: Tue, 19 Jun 2007 20:50:32 +0200
User-agent: KMail/1.9.7

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
$(foreach ARG,abc def ghi,$(eval $(call bogo,$(ARG))))
all:
##################################################

address@hidden:~/cvs/www.t5$ make -f bug.make
bug.make:11: this should not be evaluated here: (bogo abc)
bug.make:11: this should not be evaluated here: (bogo def)
bug.make:11: this should not be evaluated here: (bogo ghi)
make: Nothing to be done for `default'.

As far as i understand, comments are comments, regardless of the 
context. ???

My assumption is that this also applies to other $(functions) inside 
such a comment, but i haven't tried it out.

Or is this a strange as-designed behaviour?


Many thanks in advance for your time and your awesome product,
(No, that's not sarcasm! i'm a huge fan!)

-- 
----- address@hidden
http://www.wanderinghorse.net

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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