Re: Library __progname cleanups - commit candidate

Mark Murray <[email protected]>
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
> > retrieving revision 1.3
> > diff -u -d -r1.3 getprogname.c
> > --- libc/gen/getprogname.c	1 Feb 2002 00:57:29 -0000	1.3
> > +++ libc/gen/getprogname.c	26 Mar 2002 08:33:48 -0000
> > @@ -3,10 +3,12 @@
> >
> >  #include <stdlib.h>
> 
> This is missing includes of "namespace.h" and "un-namespace.h", except
> you do things in a nonstandard way.  Similarly elsewhere.  Not so
> similarly in err.c above (I limited the scopy of the namespace includes
> too carefully there, so they don't already cover <stdlib.h>).

You don't think this "standard way" could be documented somewhere, do you?

> Why not use the standard namespace mechanism?  It just happens that
> this header provides a convenient place to put prototype for the
> implementatation name so that a less hackish mechanism can be used,
> but this is surprising.

"Standard"? No documentation == no standard. Even the headers
themselves have no useful comments.

> > -			snprintf(str, sizeof(str), "%s - Warning: Thread %p attempted to lock %p from %s (%d) was left locked from %s (%d)\n", __progname, curthread, lck, fname, lineno, lck->fname, lck->lineno);
> > +			snprintf(str, sizeof(str), "%s - Warning: Thread %p attempted to lock %p from %s (%d) was left locked from %s (%d)\n", _getprogname(), curthread, lck, fname, lineno, lck->fname, lck->lineno);
> 
> Disgustingly long line longer than before.

I'd prefer to solve this with an appropriate indent(1).

M
-- 
o       Mark Murray
\_
O.\_    Warning: this .sig is umop ap!sdn

To Unsubscribe: send mail to [email protected]
with "unsubscribe freebsd-audit" in the body of the message
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.