NetBSD Problem Report #19359

Received: (qmail 29808 invoked by uid 605); 12 Dec 2002 01:11:26 -0000
Message-Id: <200212120111.UAA04624@Sparkle.Rodents.Montreal.QC.CA>
Date: Wed, 11 Dec 2002 20:11:13 -0500 (EST)
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Sender: gnats-bugs-owner@netbsd.org
Reply-To: mouse@Rodents.Montreal.QC.CA
To: gnats-bugs@gnats.netbsd.org
Subject: mkdep breaks for #*.c files
X-Send-Pr-Version: 3.95

>Number:         19359
>Category:       bin
>Synopsis:       [dM] mkdep breaks for #*.c files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 12 01:12:00 +0000 2002
>Closed-Date:    Fri Oct 15 05:57:46 +0000 2010
>Last-Modified:  Fri Oct 15 05:57:46 +0000 2010
>Originator:     der Mouse
>Release:        1.6_BETA4
>Organization:
	Dis-
>Environment:
	Noticed on /sparc 1.4T; verified present on /i386 1.6_BETA4.
>Description:
	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.
>How-To-Repeat:
	$ 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".
>Fix:
	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	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
>Release-Note:
>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/19359 CVS commit: src/usr.bin/mkdep
Date: Fri, 15 Oct 2010 05:46:48 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Fri Oct 15 05:46:48 UTC 2010

 Modified Files:
 	src/usr.bin/mkdep: mkdep.1

 Log Message:
 Per PR 19359 note that mkdep doesn't handle all make metacharacters
 correctly; in particular, filenames containing '#' cause trouble,
 although '$' seems to be ok. Bump date.


 To generate a diff of this commit:
 cvs rdiff -u -r1.14 -r1.15 src/usr.bin/mkdep/mkdep.1

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 15 Oct 2010 05:57:46 +0000
State-Changed-Why:
I put a note in the man page. Since the problem is actually in gcc -M
(try gcc -M '#foo.c' 'foo$bar.c' etc.) it's almost certainly not worth
trying to fix it properly.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.