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

2022-05-06 Thread Scott Moser
Follow-up Comment #4, bug #62381 (project make):

@Paul,
Thanks for your time. Sorry I had not seen the NEWs file which does have a
very good explanation.


___

Reply to this item at:

  

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




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

2022-04-28 Thread Paul D. Smith
Follow-up Comment #3, bug #62381 (project make):

It's not a duplicate of bug #60799 though: that's related to handling of
second expansion.


___

Reply to this item at:

  

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




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

2022-04-28 Thread Paul D. Smith
Update of bug #62381 (project make):

  Status:None => Not A Bug  
 Open/Closed:Open => Closed 

___

Follow-up Comment #2:

This is discussed in the NEWS file for GNU make 4.3:


* WARNING: Backward-incompatibility!
  Number signs (#) appearing inside a macro reference or function invocation
  no longer introduce comments and should not be escaped with backslashes:
  thus a call such as:
foo := $(shell echo '#')
  is legal.  Previously the number sign needed to be escaped, for example:
foo := $(shell echo '\#')
  Now this latter will resolve to "\#".  If you want to write makefiles
  portable to both versions, assign the number sign to a variable:
H := \#
foo := $(shell echo '$H')
  This was claimed to be fixed in 3.81, but wasn't, for some reason.
  To detect this change search for 'nocomment' in the .FEATURES variable.


https://git.savannah.gnu.org/cgit/make.git/tree/NEWS?h=4.3#n18


___

Reply to this item at:

  

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




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

2022-04-28 Thread Scott Moser
Follow-up Comment #1, bug #62381 (project make):

I intended to say, this seems likely related to
https://savannah.gnu.org/bugs/?60799 . Maybe it is a duplicate.


___

Reply to this item at:

  

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




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

2022-04-28 Thread Scott Moser
URL:
  

 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:

  

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