[Top][All Lists]

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

[bug #31248] .SECONDEXPANSION: Inconsistent expansion of glob patterns i

From: Paul D. Smith
Subject: [bug #31248] .SECONDEXPANSION: Inconsistent expansion of glob patterns in pattern rule dependency lines
Date: Sun, 8 Jan 2023 14:32:58 -0500 (EST)

Follow-up Comment #1, bug #31248 (project make):

I've tested this with the latest GNU Make 4.4(.1).  I didn't really follow all
the discussion of previous behaviors, but here is how things currently behave,
which doesn't seem right to me:

Given the setup below, when run without second expansion:

$ make SEC=no
dir/foo.x from dir/foo.ybot

we can see that the directory prefix "dir/" is added to the pattern "%y*"
_before_ the glob is expanded, so that the expansion finds the pre-existing

However if we enable second expansion:

$ make SEC=yes
dir/foo.x from dir/foo.ytop

we can see that here, the pattern is replaced giving "foo.y*" and the glob is
expanded before the directory prefix "dir/" is added, yielding foo.ytop which
is then changed to "dir/foo.ytop".

Clearly the fact that these work differently is wrong.

As for which should happen, my preference would probably be to change the
second expansion one to work like the no-second-expansion one, where first the
directory prefix is handled then the glob expansion is done afterward.  Adding
the directory prefix is part of expanding the pattern, and expanding the
pattern should happen before the glob match.


Reply to this item at:


Message sent via Savannah

reply via email to

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