[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #42599] .RECIPEPREFIX should not have to be at beginning of line
From: |
Paul D. Smith |
Subject: |
[bug #42599] .RECIPEPREFIX should not have to be at beginning of line |
Date: |
Fri, 27 Jun 2014 18:56:33 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0 |
Follow-up Comment #1, bug #42599 (project make):
FYI, .RECIPEPREFIX was added in GNU make 3.82.
I agree the error message is incorrect. In fact we shouldn't even be making
that extra check in the case where RECIPEPREFIX is set.
I'm not sure I agree with the preceding whitespace request though. This adds
a lot of possibility for error into the parsing: if your recipe prefix happens
to match some character at the beginning of the line for example. What about
this:
.RECIPEPREFIX = |
all:
| find . -type f ... \
| xargs grep -lv foobar
| while read f; do echo "file: $$f"; done
See the missing backslash at the end of the "xargs" line? Currently make will
fail because it cannot parse the "while" line (no RECIPEPREFIX). If we allow
leading whitespace then that looks like a recipe line and make will run it...
and hang forever because the "read" is trying to read from stdin.
The rule for recipe prefixes is currently very simple: check the single first
character on the line and see if it's the recipe introduction character.
Adding the ability to precede it with whitespace is something I'd have to
think very carefully about.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?42599>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/