bug-make
[Top][All Lists]
Advanced

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

[bug #62381] use of hash (#) changed behavior 4.2 to 4.3


From: Scott Moser
Subject: [bug #62381] use of hash (#) changed behavior 4.2 to 4.3
Date: Thu, 28 Apr 2022 10:36:14 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?62381>

                 Summary: use of hash (#)  changed behavior 4.2 to 4.3
                 Project: make
            Submitted by: smoser
            Submitted on: Thu 28 Apr 2022 02:36:12 PM UTC
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.3
        Operating System: POSIX-Based
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

I recently started using gnu make version 4.3, changing from 4.2.1, and hit a
change in behavior on use of the "#" character.

I had this:


---- my.mk ----
foo := $(shell n="bar-bar"; echo ${{n\#\#*-})
debug:
    @echo foo=$(foo)
------

4.2.1 shows:
$ make -f my.mk
foo=bar

With 4.3 I get:
$ make -f my.mk
/bin/sh: 1: Bad substitution
foo=

The solution that works in both versions is:
--- my-fixed.mk ---
hash := \#
foo := $(shell n=bar-bar; echo $${n$(hash)$(hash)*-})
debug:
  @echo foo=$(foo)
---------





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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