bug-make
[Top][All Lists]
Advanced

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

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


From: Paul D. Smith
Subject: [bug #59956] Recipes inside conditionals can break the parser
Date: Wed, 27 Jan 2021 16:36:33 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36

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
program named *else* that you want to run, which no sane person would ever do,
but even if you did want to do that the shell will consider the *else* to be a
keyword; so you'd have to write *./else* or something and then make wouldn't
match it either.

If you do use *.ONESHELL:* then you need to have the entire recipe in a make
*if* block with *else* as its own token on the recipe line.  Using
*.ONESHELL:* is still not that common and putting entire rules inside an *if*
block is also not that common.  *ifeq* etc. are more commonly used around
variable assignments or maybe include files.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59956>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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