Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2002 12:50:02 -0800 (PST)
From:      "Simon 'corecode' Schubert" <corecode@corecode.ath.cx>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/35119: make(1) variable modifier bug (:L, :U etc)
Message-ID:  <200202192050.g1JKo2I94427@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/35119; it has been noted by GNATS.

From: "Simon 'corecode' Schubert" <corecode@corecode.ath.cx>
To: stijn@win.tue.nl
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/35119: make(1) variable modifier bug (:L, :U etc)
Date: Tue, 19 Feb 2002 21:42:30 +0100

 --OFN=.KLuoT/o68,X
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 
 On Tue, 19 Feb 2002 16:47:38 +0100 (CET) stijn@win.tue.nl wrote:
 
 > 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.
 
 i believe this is already known. make processes all statements on an .if line, no matter if this is needed or not (unlike most other languages):
 
 ..if defined(FOO) && ${FOO} == "bar"
 will result in the following (without having FOO defined):
 res1 := test FOO for existance = false
 res2 := test FOO == "bar" = false
 
 res := res1 && res2 == false
 
 if you use a modifier, make will (of course [knowing the fact above]) complain about the variable not being assigned.
 
 Fix:
 
 ..if defined(FOO)
 ..if ${FOO:L} == "bar"
 
 ..endif
 ..endif
 
 so it's got nothing to do with defined() and the modifiers, more with the way make processes conditionals.
 
 cheerz
   corecode
 
 
 -- 
 /"\   http://corecode.ath.cx/
 \ /
  \     ASCII Ribbon Campaign
 / \  Against HTML Mail and News
 
 --OFN=.KLuoT/o68,X
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.0.6 (FreeBSD)
 
 iD8DBQE8cri9r5S+dk6z85oRAmEXAJ9+NdS8HmbX1oN1nUGI7aqS8DIS3QCcCUZz
 Hv0zwITEM3CMRoZHw+2D8oc=
 =mrj0
 -----END PGP SIGNATURE-----
 
 --OFN=.KLuoT/o68,X--
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202192050.g1JKo2I94427>