From 7b39e612db568db7cf0e415e3ec6ccb34b381398 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 20 Nov 2020 11:30:42 +0900 Subject: [PATCH] include/nuttx/compiler.h: Add sysloglike macro Right now, same as printflike. Introduce a separate macro because syslog takes a bit different format from printf. (ie. %m) If it turns out that a compiler is not happy with the difference, we can disable this selectively. --- include/nuttx/compiler.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index 2ee6bcf5799..9b50bc146e9 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -144,6 +144,7 @@ # define noinline_function __attribute__ ((noinline)) # define printflike(a, b) __attribute__((__format__ (__printf__, a, b))) +# define sysloglike(a, b) __attribute__((__format__ (__printf__, a, b))) # define scanflike(a, b) __attribute__((__format__ (__scanf__, a, b))) /* GCC does not use storage classes to qualify addressing */ @@ -362,6 +363,7 @@ # define noinline_function # define printflike(a, b) +# define sysloglike(a, b) # define scanflike(a, b) /* The reentrant attribute informs SDCC that the function @@ -491,6 +493,7 @@ # define inline_function # define noinline_function # define printflike(a, b) +# define sysloglike(a, b) # define scanflike(a, b) /* REVISIT: */ @@ -593,6 +596,7 @@ # define inline_function # define noinline_function # define printflike(a, b) +# define sysloglike(a, b) # define scanflike(a, b) # define FAR @@ -650,6 +654,7 @@ # define inline_function # define noinline_function # define printflike(a, b) +# define sysloglike(a, b) # define scanflike(a, b) # define FAR