bugmake - Bugs: bug #62278, Fix % substitution in static...

 
 

bug #62278: Fix % substitution in static pattern rules.

Submitter:  Dmitry Goncharov <dgoncharov>
Submitted:  Sat 09 Apr 2022 03:30:51 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.4 Operating System:  Any
Fixed Release:  4.4 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 24 Apr 2022 06:24:00 PM UTC, comment #2: 

Thanks, fixed!

Paul D. Smith <psmith>
Group administrator
Sat 09 Apr 2022 03:36:43 PM UTC, comment #1: 

Tested on 64 and 32 bit linux.

Dmitry Goncharov <dgoncharov>
Sat 09 Apr 2022 03:30:51 PM UTC, original submission:  

When second expansion is enabled make substitutes all instances of a '%' in each prerequisite of a static pattern rule.



$ cat makefile
.SECONDEXPANSION:
all: hello.x
hello.x: %.x: $$(wordlist 1, 99, %_%_%.1 %_%_%.2); $(info $@ from $^)
$ /usr/bin/make
make: *** No rule to make target 'hello_hello_hello.1', needed by 'hello.x'.  Stop.


This patch
1. Causes make to substitute only the first instance of '%' in each prerequisite of a static pattern rule when second expansion is enabled.

So, the example above results in


$ ~/src/gmake/make/l64/make
make: *** No rule to make target 'hello_%_%.1', needed by 'hello.x'.  Stop.


2. Adds a set of tests to verify that stem substitution is the same whether second expansion is enabled or not.

3. Fixes a memory leak in expand_deps

Dmitry Goncharov <dgoncharov>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #53059:  sv62278_test.diff added by dgoncharov (6KiB - text/x-patch)
file #53060:  sv62278_fix.diff added by dgoncharov (3KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by dgoncharov (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-04-24 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.4
    2022-04-09 dgoncharov Attached File- Added sv62278_test.diff, #53059
        Attached File- Added sv62278_fix.diff, #53060

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code