[bug #59956] Recipes inside conditionals can break the parser

2021-01-28 Thread Dmitry Goncharov
Follow-up Comment #8, bug #59956 (project make): i mean, the user would tell make through some option (a special target or even presence of ".else" in the makefile) "this makefile uses .else, rather then else". make then would not consider "else" a keyword. The keyword does not have to be

Re: [bug #59956] Recipes inside conditionals can break the parser

2021-01-28 Thread Edward Welbourne
> Consider the following example: > ifeq (1,0) > test: > @if [ "asd" == "123" ]; then > echo "true" > else > echo "false" > fi > endif > The *else* recipe at line 5 is treated as part of the *ifeq (1,0)* > conditional thus making the next

[bug #59956] Recipes inside conditionals can break the parser

2021-01-27 Thread Dmitry Goncharov
Follow-up Comment #6, bug #59956 (project make): What about adding another keyword, e.g. .else? ___ Reply to this item at: ___ Message sent via

[bug #59956] Recipes inside conditionals can break the parser

2021-01-27 Thread Paul D. Smith
Follow-up Comment #4, bug #59956 (project make): Any target can have a recipe, even special targets like *.PHONY:*, *.POSIX:*, *.ONESHELL:*, etc. Those recipes are ignored but they are syntactically legal. I guess there would be value in mentioning them if some sort of "warning mode" were

[bug #59956] Recipes inside conditionals can break the parser

2021-01-27 Thread Bogdan V
Follow-up Comment #3, bug #59956 (project make): Thanks for the even more detailed explanation than on Stack Overflow :) I didn't realize special targets like *.ONESHELL:* can also have a recipe. As a clarification, when I mentioned *.RECIPEPREFIX:* I was also implying actually using it in the

[bug #59956] Recipes inside conditionals can break the parser

2021-01-27 Thread Paul D. Smith
Follow-up Comment #2, bug #59956 (project make): It may seem trivial but in reality it's pretty hard to hit. There is essentially only one way it can happen (in valid make recipes), and that's by using *.ONESHELL:*. If you don't use *.ONESHELL:* then the only way it can happen is if you have a

[bug #59956] Recipes inside conditionals can break the parser

2021-01-27 Thread Paul D. Smith
Follow-up Comment #1, bug #59956 (project make): There is one real bug here, but everything else is just an understandable consequence of that same bug. The real bug is that the "else" that is part of a recipe, is being interpreted by make as an "else" match for the ifeq. This is because while

[bug #59956] Recipes inside conditionals can break the parser

2021-01-27 Thread anonymous
URL: Summary: Recipes inside conditionals can break the parser Project: make Submitted by: None Submitted on: Wed 27 Jan 2021 08:29:00 PM UTC Severity: 3 - Normal Item