deprintf() (was: Status update)

Alejandro Colomar via Mutt-dev <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <aYsXlL12v9EwsK9A@devuan>
Hi Kevin,

On 2026-02-10T11:05:51+0800, Kevin J. McCarthy wrote:
> Debug statements have been completely converted from dprint() to dprintf()

dprintf() is an unfortunate name, since there's a GNU/BSD libc API
--standardized in POSIX.1-2008-- with that name:

     int dprintf(int fd, const char *restrict format, ...);

     The function dprintf() is the same as  fprintf()  except  that  it
     outputs to a file descriptor, fd, instead of to a stdio(3) stream.

In fact, it's especially confusing because both take an int as their
first argument.  At first, I thought you were using the standard one.

We could call it dbgprintf() maybe?  Or maybe gprintf() if you want it
short, as 'g' is the usual one letter for meaning debug (e.g., -Og)?

> (and deprintf()).

About deprintf(), I also have naming concerns.

eprintf() is a relatively common wrapper around fprintf(3) that prints
to stderr.

	#define eprintf(...) fprintf (stderr, __VA_ARGS__)

See for example
<https://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/Variadic-Macros.html>.

> The latter version no longer requires a newline, and
> automatically logs function, file, and line number. deprintf() additionally
> logs the errno for system call failures.

I've written a similar function in other project, and I called it
fprinte() (replacing the 'f' by the 'e').  Maybe we could call this
dbgprinte().

I could send a couple of patches for that.


Have a lovely day!
Alex

> 
> dprint() has been removed, so please update your patches to use that.
> 
> -- 
> Kevin J. McCarthy
> GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA



-- 
<https://www.alejandro-colomar.es>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmmLGqcACgkQ64mZXMKQ
wqmywg//ZY6x3U6k8id8caaA8I5fgpLwWMQ4Rpx9Mgth0AJIxgLNHUTkonyA+tIs
gii9ThHsY3lNtzF/sM5zhuubIMD6xvXrSzR4EVMAHUMTCz+xq7dSWZ4O3iQJ3GPv
XTTJKlNh6KSHJn4I+CPYqbmz9sDZIL6RXrkV8MD1vwA6hayPMuKb+UWIZdw4W3RM
+VIwoa+oNWmZtSkUu0PbwT9ld+WUw4HcRDZMx6aqPBY0IscYWfu2PXvoHdFoAXrg
evN6glAxNK1r3RVU+1X4mu0PkRpVbJ3DSQ34nfMagrUvZSoHdhso/OucS8uHOY3c
x/HHVLf9UbhBbRiuu2Z4kf/U0sb/KptvC9kS0oZqsCh6EYOStbgCQTng7tkhcFlB
hKyHzvd9NtqtA/TtgxJbMB1icTyGSEsdvJNaTD/PY8LZcIVurkdvqFE2OPJ2AtsP
FRvo4lG+wGbjejEuTkxk+5kmdZkctYxSSa9QMH41NzSQZ68I0GkdTHouzsRJe7Gs
v6yT8WywrLc8qm58t7x1dilqmuJwP6JXZGtEFM0KlxemAqeLw3jZALjGPUkejyhT
EBaF65lobSrEz8Sb8VFjF3nac8TK3VOqizFyikpgVsZ9cG3VsJGumgzrZfq8UVRu
tjr0g8ajrWmOK0n0LGys/weFWSUUnQCi8pQv7K6dsQ2Zqb8UQXU=
=N7hg
-----END PGP SIGNATURE-----
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.