From owner-freebsd-audit Mon Mar 25 15:43:21 2002 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 43CA937B49B for ; Mon, 25 Mar 2002 15:42:54 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id KAA14651; Tue, 26 Mar 2002 10:41:45 +1100 Date: Tue, 26 Mar 2002 10:42:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Mark Murray Cc: audit@FreeBSD.ORG Subject: Re: src/lib __progname cleanup ; review please In-Reply-To: <200203251238.g2PCc8xG002769@grimreaper.grondar.org> Message-ID: <20020326103726.F3046-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 25 Mar 2002, Mark Murray wrote: > > > -char *__progname = empty; > > > +const char *__progname = empty; > > > > Why is the empty string spelled differently on i386's (aout case) only? > > I assume you mean "blank"? Changed to that. No, I mean the empty string (""). > > > - char *s; > > > + const char *s; > > > > This change is missing in most places. > > Fixed. > > > You might fix the style bugs involving this line when changing it. > > If "style bugs" mean the declaration should be moved to the top > of the function, then fixed. No, I meant style bugs in plural. There is at least one more (a larger one): missing blank line after declarations. > > > Index: libc/gen/err.c > > > =================================================================== > > > RCS file: /home/ncvs/src/lib/libc/gen/err.c,v > > > retrieving revision 1.12 > > > diff -u -d -r1.12 err.c > > > --- libc/gen/err.c 22 Mar 2002 21:52:05 -0000 1.12 > > > +++ libc/gen/err.c 24 Mar 2002 13:42:26 -0000 > > > ... > > > @@ -110,7 +108,7 @@ > > > { > > > if (err_file == 0) > > > err_set_file((FILE *)0); > > > - fprintf(err_file, "%s: ", __progname); > > > + fprintf(err_file, "%s: ", getprogname()); > > > > A version of getprogname() that is not in the application namespace > > should be used, since some members of the err() family are called > > internally in libc. Similarly elsewhere. This is even more imporartant > > in Standard functions like malloc() and getopt(). > > I don't understand this. Standard functions can't call ones in the application namespace because the application migh have a function of that name. getprogname() is in the application namespace. See my commits for namespace de-pollution of some members of the err() family. > > > -extern const char *__progname; > > > +#include "../include/libc_private.h" > > > > Bogus path. The path to libc_private.h is in CFLAGS, and every other > > include of libc_private.h in libc/gen depends on this. Similarly > > elsewhere. > > Fixed. ("Elsewhere" == libc only, right?) "Elsewhere" == in other parts of your patch. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message