NetBSD Problem Report #19596

Received: (qmail 17356 invoked by uid 605); 29 Dec 2002 00:41:41 -0000
Message-Id: <200212290037.gBT0bJa05359@runabout.rega.pbox.org>
Date: Sun, 29 Dec 2002 01:37:19 +0100 (CET)
From: Stoned Elipot <seb@runabout.rega.pbox.org>
Sender: gnats-bugs-owner@netbsd.org
Reply-To: seb@runabout.rega.pbox.org
To: gnats-bugs@gnats.netbsd.org
Subject: cannot put comment in make .eli* conditional lines
X-Send-Pr-Version: 3.95

>Number:         19596
>Category:       bin
>Synopsis:       one cannot put comment in make .el* conditional lines
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sjg
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 29 00:42:00 +0000 2002
>Closed-Date:    Mon Dec 30 18:03:48 +0000 2002
>Last-Modified:  Sun Jan 05 21:18:53 +0000 2003
>Originator:     Stoned Elipot
>Release:        NetBSD 1.6K
>Organization:
None
>Environment:
System: NetBSD runabout 1.6K NetBSD 1.6K (RUNABOUT) #0: Sun Dec 22 11:28:35 CET 2002 root@runabout:/usr/u/seb/src/RUNABOUT/compile i386
Architecture: i386
Machine: i386
>Description:
One cannot put a comment in a .el{if,ifndef,...} line.
>How-To-Repeat:
$ cat Makefile
.ifdef(bar) # comment1
FOO=foo
.elifdef(baz) # comment2
FOO=bar
.else # comment3
FOO=baz
.endif # comment4
$ make
make: "/tmp/Makefile" line 3: Malformed conditional ((baz) # comment2)
make: Fatal errors encountered -- cannot continue

make: stopped in /tmp
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: sjg 
State-Changed-When: Mon Dec 30 01:34:38 PST 2002 
State-Changed-Why:  
Have a fix 


Responsible-Changed-From-To: bin-bug-people->sjg 
Responsible-Changed-By: sjg 
Responsible-Changed-When: Mon Dec 30 01:34:38 PST 2002 
Responsible-Changed-Why:  
Have a fix 
State-Changed-From-To: analyzed->closed 
State-Changed-By: sjg 
State-Changed-When: Mon Dec 30 10:03:27 PST 2002 
State-Changed-Why:  
Fixed in -current 

From: Simon Gerraty <sjg@juniper.net>(by way of Erik E. Fair)
To: NetBSD GNATS Problem Report Tracking System <gnats-bugs@gnats.netbsd.org>
Cc:  
Subject: Re: bin/19596: cannot put comment in make .eli* conditional lines
Date: Sun, 5 Jan 2003 13:16:54 -0800

 The following appears to fix this.

 --sjg

 Index: cond.c
 ===================================================================
 RCS file: /cvsroot/src/usr.bin/make/cond.c,v
 retrieving revision 1.13
 diff -u -p -r1.13 cond.c
 --- cond.c      2002/06/15 18:24:56     1.13
 +++ cond.c      2002/12/29 08:36:51
 @@ -544,6 +544,7 @@ CondToken(Boolean doEval)
                  t = Not;
                  condExpr++;
                  break;
 +           case '#':
              case '\n':
              case '\0':
                  t = EndOfFile;

From: Simon Gerraty <sjg@juniper.net>(by way of Erik E. Fair)
To: NetBSD GNATS Problem Report Tracking System <gnats-bugs@gnats.netbsd.org>
Cc:  
Subject: Re: bin/19596: cannot put comment in make .eli* conditional lines
Date: Sun, 5 Jan 2003 13:16:55 -0800

 On Sun, 29 Dec 2002 03:55:00 -0500, Christos Zoulas writes:
 >On Dec 29, 12:38am, sjg@juniper.net (Simon Gerraty) wrote:
 >-- Subject: Re: bin/19596: cannot put comment in make .eli* conditional lines
 >
 >That is ok, as long as it does not break ${VAR} == "#"

 Test makefile is:

 VAR=\#
 var="\#"
 v=#
 all:
 .if make(foo) # make foo
 	@echo foo
 .elif make(bar) # bar
 	@echo bar
 .else	# none of the above
 	@echo all
 	@echo 'VAR=${VAR} var=${var}'
 .endif	# done
 .if ${v} == "#"
 	@echo Looks good
 .endif

 produces:

 all
 VAR=# var="#"
 Looks good

 If you remove the comment after the .elif, that's the same result as
 from make without this change.

 So, yep looks reasonable.

 --sjg

From: christos@zoulas.com (by way of Erik E. Fair)
To: NetBSD GNATS Problem Report Tracking System <gnats-bugs@gnats.netbsd.org>
Cc:  
Subject: Re: bin/19596: cannot put comment in make .eli* conditional lines
Date: Sun, 5 Jan 2003 13:16:55 -0800

 On Dec 29, 12:38am, sjg@juniper.net (Simon Gerraty) wrote:
 -- Subject: Re: bin/19596: cannot put comment in make .eli* conditional lines

 That is ok, as long as it does not break ${VAR} == "#"

 christos

 | The following appears to fix this.
 |
 | --sjg
 |
 | Index: cond.c
 | ===================================================================
 | RCS file: /cvsroot/src/usr.bin/make/cond.c,v
 | retrieving revision 1.13
 | diff -u -p -r1.13 cond.c
 | --- cond.c      2002/06/15 18:24:56     1.13
 | +++ cond.c      2002/12/29 08:36:51
 | @@ -544,6 +544,7 @@ CondToken(Boolean doEval)
 |                 t = Not;
 |                 condExpr++;
 |                 break;
 | +           case '#':
 |             case '\n':
 |             case '\0':
 |                 t = EndOfFile;
 -- End of excerpt from Simon Gerraty

From: christos@zoulas.com (by way of Erik E. Fair)
To: NetBSD GNATS Problem Report Tracking System <gnats-bugs@gnats.netbsd.org>
Cc:  
Subject: Re: bin/19596: cannot put comment in make .eli* conditional lines
Date: Sun, 5 Jan 2003 13:16:56 -0800

 On Dec 29,  1:59am, sjg@juniper.net (Simon Gerraty) wrote:
 -- Subject: Re: bin/19596: cannot put comment in make .eli* conditional lines

 ship it then :-)

 christos

 | On Sun, 29 Dec 2002 03:55:00 -0500, Christos Zoulas writes:
 | >On Dec 29, 12:38am, sjg@juniper.net (Simon Gerraty) wrote:
 | >-- Subject: Re: bin/19596: cannot put comment in make .eli* 
 conditional lines
 | >
 | >That is ok, as long as it does not break ${VAR} == "#"
 |
 | Test makefile is:
 |
 | VAR=\#
 | var="\#"
 | v=#
 | all:
 | .if make(foo) # make foo
 | 	@echo foo
 | .elif make(bar) # bar
 | 	@echo bar
 | .else	# none of the above
 | 	@echo all
 | 	@echo 'VAR=${VAR} var=${var}'
 | .endif	# done
 | .if ${v} == "#"
 | 	@echo Looks good
 | .endif
 |
 | produces:
 |
 | all
 | VAR=# var="#"
 | Looks good
 |
 | If you remove the comment after the .elif, that's the same result as
 | from make without this change.
 |
 | So, yep looks reasonable.
 |
 | --sjg
 -- End of excerpt from Simon Gerraty
>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.