From owner-freebsd-bugs Tue Feb 19 7:50:34 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D08FC37B41C for ; Tue, 19 Feb 2002 07:50:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1JFo1k21817; Tue, 19 Feb 2002 07:50:01 -0800 (PST) (envelope-from gnats) Received: from pcwin002.win.tue.nl (pcwin002.win.tue.nl [131.155.71.72]) by hub.freebsd.org (Postfix) with ESMTP id 2509E37B400 for ; Tue, 19 Feb 2002 07:47:39 -0800 (PST) Received: (from stijn@localhost) by pcwin002.win.tue.nl (8.11.6/8.11.4) id g1JFlcm41029; Tue, 19 Feb 2002 16:47:38 +0100 (CET) (envelope-from stijn) Message-Id: <200202191547.g1JFlcm41029@pcwin002.win.tue.nl> Date: Tue, 19 Feb 2002 16:47:38 +0100 (CET) From: stijn@win.tue.nl Reply-To: stijn@win.tue.nl To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/35119: make(1) variable modifier bug (:L, :U etc) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 35119 >Category: bin >Synopsis: make(1) variable modifier bug (:L, :U etc) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 19 07:50:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Stijn Hoop >Release: FreeBSD 4.5-RC >Organization: >Environment: System: FreeBSD 4.5-RC #0: Wed Jan 16 04:30:08 CET 2002 >Description: make(1) has a buglet wrt expanding variables with modifiers. If an expansion of an undefined variable, with a modifier, is used in an .if statement like so: .if defined(FOO) && ${FOO:L} == "bar" make bombs out with a 'Malformed conditional', even if FOO is not defined. An expansion like this works correctly in the non-modified case: .if defined(FOO) && ${FOO} == "bar" performs as expected. >How-To-Repeat: Extract the following Makefile to an empty directory and type 'make'. Witness make bombing out. --- /dev/null Tue Feb 19 16:40:07 2002 +++ Makefile Tue Feb 19 16:44:15 2002 @@ -0,0 +1,23 @@ +all: + ${MAKE} -DTEST_1 result + ${MAKE} -DTEST_2 result + +.if defined(TEST_1) +.if defined(FOO) && ${FOO} != "bar" +result: + @echo "FOO != bar" +.else +result: + @echo "FOO undefined or == bar" +.endif +.endif + +.if defined(TEST_2) +.if defined(FOO) && ${FOO:L} != "bar" +result: + @echo "FOO != bar (with case permutation)" +.else +result: + @echo "FOO undefined or == bar (with case permutation)" +.endif +.endif >Fix: Unfortunately not available; hacking make is beyond me... >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message