time.h: Sprinkle strftime format attribute
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
0dc6990166
commit
985f33e42c
@ -155,6 +155,7 @@
|
|||||||
# define printflike(a, b) __attribute__((__format__ (__printf__, a, b)))
|
# define printflike(a, b) __attribute__((__format__ (__printf__, a, b)))
|
||||||
# define sysloglike(a, b) __attribute__((__format__ (__syslog__, a, b)))
|
# define sysloglike(a, b) __attribute__((__format__ (__syslog__, a, b)))
|
||||||
# define scanflike(a, b) __attribute__((__format__ (__scanf__, a, b)))
|
# define scanflike(a, b) __attribute__((__format__ (__scanf__, a, b)))
|
||||||
|
# define strftimelike(a) __attribute__((__format__ (__strftime__, a, 0)))
|
||||||
|
|
||||||
/* GCC does not use storage classes to qualify addressing */
|
/* GCC does not use storage classes to qualify addressing */
|
||||||
|
|
||||||
@ -374,6 +375,7 @@
|
|||||||
# define printflike(a, b)
|
# define printflike(a, b)
|
||||||
# define sysloglike(a, b)
|
# define sysloglike(a, b)
|
||||||
# define scanflike(a, b)
|
# define scanflike(a, b)
|
||||||
|
# define strftimelike(a)
|
||||||
|
|
||||||
/* The reentrant attribute informs SDCC that the function
|
/* The reentrant attribute informs SDCC that the function
|
||||||
* must be reentrant. In this case, SDCC will store input
|
* must be reentrant. In this case, SDCC will store input
|
||||||
@ -504,6 +506,7 @@
|
|||||||
# define printflike(a, b)
|
# define printflike(a, b)
|
||||||
# define sysloglike(a, b)
|
# define sysloglike(a, b)
|
||||||
# define scanflike(a, b)
|
# define scanflike(a, b)
|
||||||
|
# define strftimelike(a)
|
||||||
|
|
||||||
/* REVISIT: */
|
/* REVISIT: */
|
||||||
|
|
||||||
@ -607,6 +610,7 @@
|
|||||||
# define printflike(a, b)
|
# define printflike(a, b)
|
||||||
# define sysloglike(a, b)
|
# define sysloglike(a, b)
|
||||||
# define scanflike(a, b)
|
# define scanflike(a, b)
|
||||||
|
# define strftimelike(a)
|
||||||
|
|
||||||
# define FAR
|
# define FAR
|
||||||
# define NEAR
|
# define NEAR
|
||||||
@ -665,6 +669,7 @@
|
|||||||
# define printflike(a, b)
|
# define printflike(a, b)
|
||||||
# define sysloglike(a, b)
|
# define sysloglike(a, b)
|
||||||
# define scanflike(a, b)
|
# define scanflike(a, b)
|
||||||
|
# define strftimelike(a)
|
||||||
|
|
||||||
# define FAR
|
# define FAR
|
||||||
# define NEAR
|
# define NEAR
|
||||||
|
@ -215,7 +215,7 @@ FAR struct tm *localtime(FAR const time_t *timep);
|
|||||||
FAR struct tm *localtime_r(FAR const time_t *timep, FAR struct tm *result);
|
FAR struct tm *localtime_r(FAR const time_t *timep, FAR struct tm *result);
|
||||||
|
|
||||||
size_t strftime(FAR char *s, size_t max, FAR const char *format,
|
size_t strftime(FAR char *s, size_t max, FAR const char *format,
|
||||||
FAR const struct tm *tm);
|
FAR const struct tm *tm) strftimelike(3);
|
||||||
|
|
||||||
FAR char *asctime(FAR const struct tm *tp);
|
FAR char *asctime(FAR const struct tm *tp);
|
||||||
FAR char *asctime_r(FAR const struct tm *tp, FAR char *buf);
|
FAR char *asctime_r(FAR const struct tm *tp, FAR char *buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user