URL: <http://savannah.gnu.org/bugs/?33344>
Summary: Undefined variables introduce leading whitespace during variable assignment Project: make Submitted by: None Submitted on: Thu 19 May 2011 01:27:22 AM UTC Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: 3.82 Operating System: POSIX-Based Fixed Release: None Triage Status: None _______________________________________________________ Details: A null variable as the first item of a variable definition introduces leading white space, which breaks an archive target and seems at variance to the GNU Make Manual, Section 6.5, Setting Variables: "Whitespace ... immediately after the ‘=’ is ignored." A commonly used idiom illustrates the problem: # Enumerate source files: CCSRC.c = CCCSRC.cc = larry.cc curly.cc moe.cc # Compute the object files: OBJECTS_FAIL = $(CCSRC.c:.c=.o) $(CCCSRC.cc:.cc=.o) OBJECTS_SUCCESS = $(CCCSRC.cc:.cc=.o) $(CCSRC.c:.c=.o) OBJECTS_FAIL will have a leading space, whereas _SUCCESS will not. This space causes archive pre-requisites to fail (new for 3.82): fail: printF libfail.a($(OBJECTS_FAIL)) ---------------- A test case demonstrating the discrepancy is attached. This problem was found using: GNU Make 3.82 on Linux 2.6.37.6 x86_64 GNU/Linux Running the same case under Make 3.81 shows the same leading space, but archive pre-requisites will succeed. _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Thu 19 May 2011 01:27:22 AM UTC Name: stooges.mk Size: 2kB By: None <http://savannah.gnu.org/bugs/download.php?file_id=23424> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?33344> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make