[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Interest in a printf-gnu module for printf("%m")?
From: |
Bruno Haible |
Subject: |
Re: Interest in a printf-gnu module for printf("%m")? |
Date: |
Thu, 29 Nov 2018 20:31:46 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-138-generic; KDE/5.18.0; x86_64; ; ) |
Hi Eric,
> wonder if there is any interest in a
> gnulib module that provides guaranteed %m support on all platforms.
I wouldn't be interested in it, because
- The complexity cost is high: We already have 15 *printf-posix modules.
We would need to add 15 additional *printf-gnu modules.
Add then we would need to add support for it to xgettext's format string
parser, and add a way to tell xgettext to distinguish "c-format" and
"c-gnu-format" strings...
- It is a limited and ad-hoc extension of *printf. It is not useful for
printing application-defined error strings, nor native Windows
GetLastError() error strings.
> Or is better to just document in
> doc/posix-functions/*printf*.texi that %m is not portable, and that the
> recommended workaround is to manually pair "%s" with strerror(errno),
> rather than relying on gnulib.
That's what I would go for, yes.
Bruno