[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make-3.80: `eval' bug
From: |
Toomas Rosin |
Subject: |
Re: make-3.80: `eval' bug |
Date: |
Fri, 25 Oct 2002 02:39:03 +0300 (EEST) |
You <address@hidden> wrote:
your post contains some incorrect statements about how and why the
problem occurs, and also incorrect implications for the fix.
Well, make's code is not easy to debug (deep recursion), and I have
not done this before. I certainly do not see all the issues even now,
after spending a long and busy day gdb'ing it. I simply tried to find
the simplest working solution.
By the way, I was not quite correct in saying:
This is precisely the kind of thing I dreamed of being able to do
with the many-rumoured `eval' when 3.80 was not released yet!
which would imply that it was not possible without this fix.
Actually, it was:
What = $(what)
$(foreach s,$(what),$(eval prev = $(this))$(eval this = $s)$(eval \
What = $(wordlist 2,$(words $(What)),$(What)))$(eval \
$(this): $(prev)))
$(what):
@echo making $@ from $^
(i.e. without using whitespace inside `foreach' between `eval's), but
I only found this out afterwards.
However, the basic idea behind your proposed fix might be cleaner than
my solution; I'll have to think about it.
Well, my version is perhaps better in that it makes the `func_*'
functions uniform.
Pushing/popping the buffer is very safe, but kind of gross.
I would say "simple and robust" instead of "gross" :-) Had I got the
idea, I would not have hesitated to use it. In the process of
creating my own fix, I felt unsafe all the time.
Toomas.