Declare all format printers with printf format attribute

* defs.h (printllval, printnum_int, printnum_long): Mark with
format(printf) attribute.
* sock.c (sock_ioctl): Fix format string.
This commit is contained in:
Дмитрий Левин 2015-02-17 22:47:25 +00:00
parent 1c603a9e07
commit f523f103cc
2 changed files with 7 additions and 4 deletions

9
defs.h
View File

@ -491,7 +491,8 @@ extern int print_quoted_string(const char *, unsigned int, unsigned int);
((long long)((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32)))
#endif
extern int getllval(struct tcb *, unsigned long long *, int);
extern int printllval(struct tcb *, const char *, int);
extern int printllval(struct tcb *, const char *, int)
__attribute__ ((format (printf, 2, 0)));
extern void printxval(const struct xlat *, const unsigned int, const char *);
extern int printargs(struct tcb *);
@ -507,8 +508,10 @@ extern void dumpiov_in_mmsghdr(struct tcb *, long);
extern void dumpiov(struct tcb *, int, long);
extern void dumpstr(struct tcb *, long, int);
extern void printstr(struct tcb *, long, long);
extern void printnum_int(struct tcb *, long, const char *);
extern void printnum_long(struct tcb *, long, const char *);
extern void printnum_int(struct tcb *, long, const char *)
__attribute__ ((format (printf, 3, 0)));
extern void printnum_long(struct tcb *, long, const char *)
__attribute__ ((format (printf, 3, 0)));
extern void printpath(struct tcb *, long);
extern void printpathn(struct tcb *, long, unsigned int);
#define TIMESPEC_TEXT_BUFSIZE (sizeof(long)*3 * 2 + sizeof("{%u, %u}"))

2
sock.c
View File

@ -117,7 +117,7 @@ sock_ioctl(struct tcb *tcp, const unsigned int code, long arg)
#ifdef SIOCATMARK
case SIOCATMARK:
#endif
printnum_int(tcp, arg, ", %#d");
printnum_int(tcp, arg, ", %d");
case SIOCSIFNAME:
return 1;
case SIOCGIFNAME: