From owner-freebsd-arch Fri Jul 26 14:30:28 2002 Delivered-To: freebsd-arch@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 8E37B37B400; Fri, 26 Jul 2002 14:30:26 -0700 (PDT) Date: Fri, 26 Jul 2002 14:30:26 -0700 From: Juli Mallett To: Cyrille Lefevre Cc: Ruslan Ermilov , Bruce Evans , Doug Barton , Mike Barcroft , arch@FreeBSD.ORG Subject: Re: Standardized make options (or no doesn't always mean no) Message-ID: <20020726143026.B91221@FreeBSD.org> References: <3D02AB11.F373AB4@FreeBSD.org> <20020609123557.X21758-100000@gamplex.bde.org> <20020725070145.GE56367@sunbay.com> <20020725165940.GF58642@gits.dyndns.org> <20020725170940.GA40574@sunbay.com> <20020726135923.GA89959@gits.dyndns.org> <20020726082527.A69507@FreeBSD.org> <20020726154344.GB93459@gits.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020726154344.GB93459@gits.dyndns.org>; from cyrille.lefevre@laposte.net on Fri, Jul 26, 2002 at 05:43:44PM +0200 Organisation: The FreeBSD Project X-Alternate-Addresses: , , , X-Towel: Yes X-LiveJournal: flata, jmallett X-Negacore: Yes Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * De: Cyrille Lefevre [ Data: 2002-07-26 ] [ Subjecte: Re: Standardized make options (or no doesn't always mean no) ] > > Also, the diff seems reasonable, but you really do want to keep in mind > > that most places where make(1) substitutes/expands variables, it will be > > allocating memory. Leaks bad. > > re you saying that almost all occurences of : > > cp = Var_Subst(NULL, cp, VAR_GLOBAL, FALSE); > > should really be : > > cp2 = Var_Subst(NULL, cp, VAR_GLOBAL, FALSE); > free(cp); > cp = cp2; No. imagine... static void Parse_PrintLineWithSubst(cp) char *cp; { cp = Var_Subst(NULL, cp, VAR_GLOBAL, FALSE); fprintf(stderr, "%s\n", cp); free(cp); } No need for a place-holder, sometimes. > > > - /* use fprintf/exit instead of Parse_Error to terminate immediately */ > > > - fprintf(stderr, "\"%s\", line %d: %s\n", fname, lineno, errmsg); > > > + Parse_Error(PARSE_FATAL, "%s", errmsg); > > > exit(1); > > > > This seems like a regression. > > looking at Parse_Error, there is no reason here to use fprintf instead ? You're right. I was thinking Parse_Error was slightly more heavyweight. -- Juli Mallett | FreeBSD: The Power To Serve Will break world for fulltime employment. | finger jmallett@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message