This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Further format patches
- To: libc-alpha at sources dot redhat dot com
- Subject: Further format patches
- From: Andreas Jaeger <aj at suse dot de>
- Date: 07 Dec 2000 16:29:47 +0100
Here's a patch to add some format attributes. Ok to commit?
Andreas
2000-12-07 Andreas Jaeger <aj@suse.de>
* misc/error.c: Add format attributes for __error and
__error_at_line.
* nscd/dbg_log.h: Add format attribute.
============================================================
Index: misc/error.c
--- misc/error.c 2000/11/28 07:32:02 1.19
+++ misc/error.c 2000/12/07 15:25:06
@@ -74,10 +74,12 @@
/* In GNU libc we want do not want to use the common name `error' directly.
Instead make it a weak alias. */
-extern void __error (int status, int errnum, const char *message, ...);
+extern void __error (int status, int errnum, const char *message, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
extern void __error_at_line (int status, int errnum, const char *file_name,
unsigned int line_number, const char *message,
- ...);
+ ...)
+ __attribute__ ((__format__ (__printf__, 5, 6)));;
# define error __error
# define error_at_line __error_at_line
============================================================
Index: nscd/dbg_log.h
--- nscd/dbg_log.h 1998/10/18 15:04:09 1.2
+++ nscd/dbg_log.h 2000/12/07 15:25:06
@@ -22,7 +22,8 @@
extern int debug_level;
-extern void dbg_log (const char *str, ...);
+extern void dbg_log (const char *str, ...)
+ __attribute__ ((__format__ (__printf__, 1, 0)));;
extern int set_logfile (const char *logfile);
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj