discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: discuss@mdocml.bsd.lv
Cc: Joerg Sonnenberger <joerg@britannica.bec.de>
Subject: Re: mdocml: Finally use __progname, err(3) and warn(3).
Date: Fri, 6 Nov 2015 17:43:57 +0100	[thread overview]
Message-ID: <20151106164357.GH14370@athene.usta.de> (raw)
In-Reply-To: <20151106122857.GC27632@britannica.bec.de>

Hi Joerg,

Joerg Sonnenberger wrote on Fri, Nov 06, 2015 at 01:28:57PM +0100:
> On Sun, Oct 11, 2015 at 04:13:25PM -0500, schwarze@mdocml.bsd.lv wrote:

>> Finally use __progname, err(3) and warn(3).
>> That's more readable and less error-prone than fumbling around
>> with argv[0], fprintf(3), strerror(3), perror(3), and exit(3).
>> 
>> It's a bad idea to boycott good interfaces merely because standards
>> committees ignore them.  Instead, let's provide compatibility modules 
>> for archaic systems (like commercial Solaris) that still don't have
>> them.  The compat module has an UCB Copyright (c) 1993...

> No, the reason to avoid it is because __progname is in the
> implementation namespace and should be avoided as such.

My rant in the commit message was intended to address err(3),
not __progname.  But i didn't make that clear.

> That's why in NetBSD we introduced setprogname() and getprogname().
> On systems without __progname, they provided a clean abstraction
> without messing with the implementation namespace.
> On platforms with __progname, but without getprogname, the latter
> is trivially implemented as returning __progname
> and setprogname is a nop.

I just committed a patch to switch from __progname to getprogname(3),
thanks for the suggestion.

I didn't bother with platforms having __progname but not getprogname(3);
those can use argv[0] just like platforms having neither.

Yours,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2015-11-06 16:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8807850261702479663.enqueue@fantadrom.bsd.lv>
2015-11-06 12:28 ` Joerg Sonnenberger
2015-11-06 16:43   ` Ingo Schwarze [this message]
2015-11-06 16:47     ` Joerg Sonnenberger
2015-11-06 17:52       ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151106164357.GH14370@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=discuss@mdocml.bsd.lv \
    --cc=joerg@britannica.bec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).