Apache OpenOffice (AOO) Bugzilla – Issue 67166
empty macros used in target definitions should trigger a warning if redefined later
Last modified: 2013-08-07 15:34:52 UTC
dmake should issue a warning for when a previously unset macro (i.e. it is assumed to be empty) is used and later set to a different value. The following example, see also issue 67145, -- makefile.mk -- SHELL*:=/bin/sh SHELLFLAGS*:=-ce # NEWDEP= all: $(NEWDEP) echo $@ NEWDEP=my_dependency -- makefile.mk -- shows a case where we currently allow the use of an empty macro without warning that it is (re-)defined in line 9. If the macro would have been defined, even by setting it to "", (for example by uncommenting line 4) the current dmake would warn about the redefinition. Adding this warning makes it easy to catch faulty target definitions where the prerequisites are expanded early and late evaluation with $$ should have been used. See again issue 67145 for such a problem.
Created attachment 37612 [details] Patch for dmake
nice to get this! i would suggest to have a CWS for fixing the new warnings before releasing the dmake issueing this warings
Previous patch breaks the OOo build in subtle way that can be illustrated by this testcase: --- t67166.mk --- SHELL*:=/bin/sh SHELLFLAGS*:=-ce .IF $(AAA)!=123 BLA=bla .ENDIF AAA*=123 all: +echo "AAA:$(AAA):" --- t67166.mk --- $ ./dmake/dmake.exe -rf t67166_1.mk AAA:: The expanding of $(AAA) in the .IF condition lets the following *= assignment think that the macro is already assigned so that it doesn't set the macro.
Created attachment 37798 [details] New patch for dmake
The previous patch survived 2/3 of a full OOo build (still building) so far. Committed the patch and two testcases to CWS dmake46. Reassigning for verification.
@ause: Please verify.
btw.: CWS ause066 does remove lots of these warnings.
.