Add sentinel attribute to printxvals

* gcc_compat.h (ATTRIBUTE_SENTINEL): New macro.
* defs.h (printxvals): Add ATTRIBUTE_SENTINEL.
This commit is contained in:
Дмитрий Левин 2016-04-01 00:52:01 +00:00
parent ccdc82a57d
commit b0d23cc2c0
2 changed files with 8 additions and 1 deletions

3
defs.h
View File

@ -554,7 +554,8 @@ extern int printllval(struct tcb *, const char *, int)
ATTRIBUTE_FORMAT((printf, 2, 0));
extern void printaddr(long);
extern void printxvals(const unsigned int, const char *, const struct xlat *, ...);
extern void printxvals(const unsigned int, const char *, const struct xlat *, ...)
ATTRIBUTE_SENTINEL;
#define printxval(xlat, val, dflt) printxvals(val, dflt, xlat, NULL)
extern int printargs(struct tcb *);
extern int printargs_u(struct tcb *);

View File

@ -64,6 +64,12 @@
# define ATTRIBUTE_NOINLINE /* empty */
#endif
#if GNUC_PREREQ(4, 0)
# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__))
#else
# define ATTRIBUTE_SENTINEL /* empty */
#endif
#if GNUC_PREREQ(4, 3)
# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
#else