Warnings regarding %m used in non-syslog functions on NetBSD 8
Example:
../../ntpd/ntp_io.c:1962:14: warning: %m is only allowed in syslog(3) like functions [-Wformat=]
(unsigned)qos, socktoa(addr));
^
There are 146 of these warnings.
Some information I found about this:
- https://mail-index.netbsd.org/tech-toolchain/2015/10/13/msg002670.html
- https://mail-index.netbsd.org/tech-toolchain/2015/10/14/msg002673.html
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67956
According to TOG (http://pubs.opengroup.org/onlinepubs/009695399/functions/fprintf.html), %m is not a legal formatting character for printf(3) like functions. Some implementations (glibc) accept this formatting character as an extension and expand it to the error string via strerror(3) that errno currently points to. Most other c library implementations do not expand %m.