addsuffix manual example wrong, se_implicit test 4 fails.

"John E. Malmberg" <[email protected]> Wed, 17 Sep 2014 20:34:06 -0500
Newsgroups gmane.comp.gnu.make.devel
Message-ID <[email protected]>
This was noticed on make help in 2010.

http://gnu-make.2324884.n4.nabble.com/There-is-a-bug-in-the-make-manual-td11187.html

In the section on Secondary Expansion of Implicit Rules:

In this example:

      .SECONDEXPANSION:

      /tmp/foo.o:

      %.o: $$(addsuffix /%.c,foo bar) foo.h
              @echo $^

It is claimed that $$(addsuffix /%c,foo bar) for the stem '/tmp/foo' 
will expand to '/tmp/foo/foo.c /tmp/bar/foo.c'.

It actually expands to 'foo//tmp/foo.c bar//tmp/foo.c', which means the 
example does not work.

I tested this behavior with make 3.81 on Ubuntu 14.04 LTS.

This same example is test #4 in the se_implicit test, and it is failing 
for me on the Make 4.0.0.  The debugger confirms that addsuffix is 
working the same as what I see on 3.8.1, which implies that this test 
should not pass.

Am I missing something here?

Even though this was noticed in 2010, I could not find a ticket for it.

Regards,
-John
[email protected]