This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Patch to add attributes to <sys/syslog.h>
- To: libc-alpha at sources dot redhat dot com
- Subject: Patch to add attributes to <sys/syslog.h>
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Thu, 7 Dec 2000 11:30:52 +0000 (GMT)
<sys/syslog.h> should have format attributes for syslog and vsyslog.
Patch below.
(Adding -Wmissing-format-attribute to the all-warnings case might find
more cases, but would need to be autoconfed since it needs a recent
compiler.)
--- syslog.h Sat Oct 9 21:22:07 1999
+++ syslog.h.new Thu Dec 7 11:25:19 2000
@@ -179,12 +179,13 @@
extern int setlogmask (int __mask) __THROW;
/* Generate a log message using FMT string and option arguments. */
-extern void syslog (int __pri, __const char *__fmt, ...) __THROW;
+extern void syslog (int __pri, __const char *__fmt, ...) __THROW
+ __attribute__((__format__(__printf__, 2, 3)));
#ifdef __USE_BSD
/* Generate a log message using FMT and using arguments pointed to by AP. */
extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
- __THROW;
+ __THROW __attribute__((__format__(__printf__, 2, 0)));
#endif
__END_DECLS
--
Joseph S. Myers
jsm28@cam.ac.uk