Subject: bin/19359: mkdep breaks for #*.c files
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: netbsd-bugs
Date: 12/11/2002 20:11:13
>Number:         19359
>Category:       bin
>Synopsis:       [dM] mkdep breaks for #*.c files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 11 17:12:00 PST 2002
>Originator:     der Mouse
>Release:        1.6_BETA4
	Noticed on /sparc 1.4T; verified present on /i386 1.6_BETA4.
	If mkdep is passed .c filenames beginning with a # character,
	and those files do enough including to generate more than one
	line in .depend (#include <stdio.h> is enough), the resulting
	.depend file produces fatal errors from make, because mkdep
	generates what make interprets as a comment line.
	$ mkdir testdir
	$ cd testdir
	$ echo '#include <stdio.h>' > \#foo.c
	$ mkdep \#foo.c
	$ make
	watch make produce errors for the last line of #foo.c's
	dependencies in .depend, saying "Need an operator".
	Make mkdep convert # to \# when writing .depend?  (Doing this
	by hand after mkdep runs produces a .depend make is happy
	with.)  Alternatively, document it and forget it; such files
	are obviously not much used, or the bug would not have lasted
	this long.  (Other characters in .c filenames can cause
	problems; for example, a newline in a .c filename produces
	broken .depend files; a colon does too, though the brokenness
	is subtler.  I do note space and tab get escaped correctly;
	perhaps it's as simple as adding # to that list.)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B