NetBSD Problem Report #4778
Received: (qmail 1284 invoked from network); 5 Jan 1998 13:01:36 -0000
Message-Id: <199801051301.IAA13207@Twig.Rodents.Montreal.QC.CA>
Date: Mon, 5 Jan 1998 08:01:04 -0500 (EST)
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Reply-To: mouse@Rodents.Montreal.QC.CA
To: gnats-bugs@gnats.netbsd.org
Subject: make .if empty() breaks with .for formal
X-Send-Pr-Version: 3.95
>Number: 4778
>Category: toolchain
>Synopsis: make .if empty() breaks with .for formal
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: toolchain-manager
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Jan 05 05:05:02 +0000 1998
>Closed-Date: Sun Dec 21 21:19:58 +0000 2008
>Last-Modified: Sun Dec 21 21:19:58 +0000 2008
>Originator: der Mouse
>Release: 1.3
>Organization:
Dis-
>Environment:
NetBSD/sparc on a SS1+
>Description:
make(1)'s .if empty() directive breaks when used to test a
(modified form of a) loop formal of a .for loop; make reacts as
though the loop formal were undefined. (The "Malformed
conditional" error below is the same error I get when I apply
.if empty() to an undefined variable.)
>How-To-Repeat:
% cat z
FOO != echo x; echo FLARP is $(FLARP) 1>&2
.for x in $(FLARP)
.if empty(x:E:Na)
FOO != echo x; echo the .if is true 1>&2
.else
FOO != echo x; echo the .if is false 1>&2
.endif
.endfor
% make -f z FLARP='foo.a bar.so'
FLARP is foo.a bar.so
"z", line 1: Malformed conditional (empty(x:E:Na))
"z", line 1: Missing dependency operator
the .if is true
"z", line 3: if-less else
"z", line 3: Need an operator
the .if is false
"z", line 5: if-less endif
"z", line 5: Need an operator
"z", line 1: Malformed conditional (empty(x:E:Na))
"z", line 1: Missing dependency operator
the .if is true
"z", line 3: if-less else
"z", line 3: Need an operator
the .if is false
"z", line 5: if-less endif
"z", line 5: Need an operator
Fatal errors encountered -- cannot continue
% diff z z2
3c3,4
< .if empty(x:E:Na)
---
> BAR := $(x:E:Na)
> .if empty(BAR)
% make -f z2 FLARP='foo.a bar.so'
FLARP is foo.a bar.so
the .if is true
the .if is false
make: no target to make.
%
>Fix:
I suspect that .for loops are implemented by constructing
transient makefile segments consisting of the body with the
iteration variable substituted out, which would explain several
oddities I've seen, including this bug. If so, about the only
hope is a reimplementation of .for, though in the interim it
would probably be a workable substitute to splatter warnings
all over the man page that .for loop formals do not work as
empty() arguments (and other such situations, if any).
der Mouse
mouse@rodents.montreal.qc.ca
7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: bin-bug-people->toolchain-manager
Responsible-Changed-By: gnats
Responsible-Changed-When: Tue Feb 12 00:51:46 PST 2002
Responsible-Changed-Why:
There is now a "toolchain-manager" which is the proper default role
account for handling problem reports in the toolchain category.
State-Changed-From-To: open->closed
State-Changed-By: dsl@NetBSD.org
State-Changed-When: Sun, 21 Dec 2008 21:19:58 +0000
State-Changed-Why:
Fixed!
>Unformatted:
(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.