tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: "%m" formatting code and "syslog like"



On Fri, Aug 31, 2018 at 01:23:51PM +0100, Roy Marples wrote:
> This allows dhcpcd to be compiled with full warnings, but I've disabled the
> check for specific functions. This is actually self defeating as it's just
> the kind of function the warnings are for, but as best I can tell it's
> impossible to have your own logging function unless you either live with the
> warnings or disable them - neither is a good solution really.

Why would this not work?

You do your own logging function and mark it __printflike, then avoid
all (non portable) %m format strings by replacing them with %s and
strerror().

Martin


Home | Main Index | Thread Index | Old Index