printf("%m") doesn't generate a warning -- shouldn't it?
Poul-Henning Kamp
phk at phk.freebsd.dk
Tue May 22 09:37:26 UTC 2018
--------
In message <CABh_MKkWOaKZxqye2zW7tGF2Pro6hvnf5PHTgY8HqtHrFCprqg at mail.gmail.com>
, Ed Schouten writes:
>2018-05-21 15:43 GMT+02:00 Konstantin Belousov <kostikbel at gmail.com>:
>> Why not add %m instead ? It is very easy and several people did it in
>> round-about ways.
>
>Added advantage of that approach is that it allows the syslog()
>function to be simplified significantly. No need to expand the %m
>there, which ends up being quite messy.
We have an cleanly expandable printf implementation for exactly
this kind of stuff, so that is not really the case.
However, expandable printf is close to useless when there is no
sane/portable way to teach compilers about new formatting arguments.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the freebsd-hackers
mailing list