Sorry for the crappy explanation. I was a bit in a hurry when I wrote my last topic. I'm not using it in a printf call, I am using it in a syslog call. However, this is the declaration (in sys/syslog.h):
So, g++ checks whether it's a valid format string for printf. That is what that attribute does. However, it's not a valid printf format string because it allows %m, which is not allowed by printf. That's what it complains about.
extern void syslog (int __pri, __const char *__fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
Right now, I modified the header file in /usr/include (I removed the attribute), as I feel that it is actually this header file that is incorrect here. According to the manuals it seems to be at least. And now there aren't any warnings anymore. But do you have any idea on how to fix this properly?
I mean, I really can't be the only person to get this warning, as I reckon %m in syslog is really common.
Just an example snippet of my code that results in that warning:
syslog(LOG_WARNING, "accept: %m");