Use __nonnull__ attribute in __printflike.

This commit is contained in:
Todd C. Miller
2013-08-18 14:18:55 -06:00
parent 7a76844d98
commit 5caa61d687

View File

@@ -45,14 +45,20 @@
/* For catching format string mismatches */
#ifndef __printflike
# if __GNUC_PREREQ__(2, 7)
# if __GNUC_PREREQ__(3, 3)
# define __printflike(f, v) __attribute__((__format__ (__printf__, f, v))) __attribute__((__nonnull__ (f)))
# elif __GNUC_PREREQ__(2, 7)
# define __printflike(f, v) __attribute__((__format__ (__printf__, f, v)))
# else
# define __printflike(f, v)
# endif
#endif
#ifndef __printf0like
# define __printf0like __printflike
# if __GNUC_PREREQ__(2, 7)
# define __printf0like(f, v) __attribute__((__format__ (__printf__, f, v)))
# else
# define __printf0like(f, v)
# endif
#endif
/* Hint to compiler that returned pointer is unique (malloc but not realloc). */