[bug #64112] ...\$(...) or ...\\$(...) give unexpected result

2023-04-26 Thread Pascal J. Bourguignon
URL:
  

 Summary: ...\$(...) or ...\\$(...) give unexpected result
   Group: make
   Submitter: informatimago
   Submitted: Wed 26 Apr 2023 08:10:40 AM UTC
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: 4.1
Operating System: None
   Fixed Release: None
   Triage Status: None


___

Follow-up Comments:


---
Date: Wed 26 Apr 2023 08:10:40 AM UTC By: Pascal J. Bourguignon

1- the comments in the source code would seem to indicate that the intended
effect of \$(foo) is to disable variable expansion, ie. to return a token
\$(foo), and for \\$(foo), we should have a simple escape of the backslash,
and the variable should be expanded, so with the following example, we should
get \foofoo.
Instead, we get in both case ^Loofoo

Note: a first problem in the source is that $ is checked and processed before
a previous \ (function find_map_unquote in read.c).


$ make --version ; echo -- ; cat escape-dollar.mk ; echo
-- ;  make -k -f escape-dollar.mk
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
--
foo=foofoo
qux=qux$(foo)qux
bar=bar\$(foo)bar
baz=baz\\$(foo)baz
all:
@echo  "foo=$(foo)"
@echo  "qux=$(qux)"
@echo  "bar=$(bar)"
@echo  "baz=$(baz)"

--
foo=foofoo
qux=quxfoofooqux
bar=baroofoobar
baz=bazoofoobaz









___

Reply to this item at:

  

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




[bug #64115] make warns about undefined variable GNUMAKEFLAGS

2023-04-26 Thread Dmitry Goncharov
URL:
  

 Summary: make warns about undefined variable GNUMAKEFLAGS
   Group: make
   Submitter: dgoncharov
   Submitted: Wed 26 Apr 2023 11:23:13 AM UTC
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: SCM
Operating System: Any
   Fixed Release: None
   Triage Status: None


___

Follow-up Comments:


---
Date: Wed 26 Apr 2023 11:23:13 AM UTC By: Dmitry Goncharov 
.







___

Reply to this item at:

  

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




[bug #64115] make warns about undefined variable GNUMAKEFLAGS

2023-04-26 Thread Dmitry Goncharov
Follow-up Comment #1, bug #64115 (project make):

make warns about undefined variable GNUMAKEFLAGS when -R is specified.


$ echo 'all:' | make -f - -R  --warn-undefined-variables
make: warning: reference to undefined variable 'GNUMAKEFLAGS'
make: Nothing to be done for 'all'.
$


This patch adds GNUMAKEFLAGS to defined_vars.


___

Reply to this item at:

  

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




[bug #64115] make warns about undefined variable GNUMAKEFLAGS

2023-04-26 Thread Dmitry Goncharov
Additional Item Attachment, bug #64115 (project make):

File name: sv64115_fix.diff   Size:0 KB


File name: sv64115_test.diff  Size:1 KB




___

Reply to this item at:

  

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




[bug #64112] ...\$(...) or ...\\$(...) give unexpected result

2023-04-26 Thread Paul D. Smith
Update of bug #64112 (project make):

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

___

Follow-up Comment #1:

I'm not sure which "comments in the source code" you're looking at, but that's
not usually a good way to learn the behavior of the software: instead you
should look at the user's manual:
https://www.gnu.org/software/make/manual/html_node/Reference.html (first
paragraph).

No version of make has ever used backslashes to escape make variable
references: you double the '$'; e.g., $$(foo)



___

Reply to this item at:

  

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