Use __nonnull__ attribute in __printflike.
This commit is contained in:
@@ -45,14 +45,20 @@
|
|||||||
|
|
||||||
/* For catching format string mismatches */
|
/* For catching format string mismatches */
|
||||||
#ifndef __printflike
|
#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)))
|
# define __printflike(f, v) __attribute__((__format__ (__printf__, f, v)))
|
||||||
# else
|
# else
|
||||||
# define __printflike(f, v)
|
# define __printflike(f, v)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef __printf0like
|
#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
|
#endif
|
||||||
|
|
||||||
/* Hint to compiler that returned pointer is unique (malloc but not realloc). */
|
/* Hint to compiler that returned pointer is unique (malloc but not realloc). */
|
||||||
|
Reference in New Issue
Block a user