compiler.h: Add printflike macro

The name was inspired from NetBSD's __printflike.

We can add similar macros for __syslog__, __scanf__, __format_arg__
later.
This commit is contained in:
YAMAMOTO Takashi 2020-11-05 17:00:09 +09:00 committed by Xiang Xiao
parent fe8026d952
commit eb406a8394
1 changed files with 7 additions and 0 deletions

View File

@ -143,6 +143,8 @@
# define inline_function __attribute__ ((always_inline,no_instrument_function))
# define noinline_function __attribute__ ((noinline))
# define printflike(a, b) __attribute__((__format__ (__printf__, a, b)))
/* GCC does not use storage classes to qualify addressing */
# define FAR
@ -358,6 +360,8 @@
# define inline_function
# define noinline_function
# define printflike(a, b)
/* The reentrant attribute informs SDCC that the function
* must be reentrant. In this case, SDCC will store input
* arguments on the stack to support reentrancy.
@ -484,6 +488,7 @@
# define naked_function
# define inline_function
# define noinline_function
# define printflike(a, b)
/* REVISIT: */
@ -584,6 +589,7 @@
# define naked_function
# define inline_function
# define noinline_function
# define printflike(a, b)
# define FAR
# define NEAR
@ -639,6 +645,7 @@
# define naked_function
# define inline_function
# define noinline_function
# define printflike(a, b)
# define FAR
# define NEAR