mirror of
https://github.com/apache/nuttx.git
synced 2026-05-13 10:38:40 +08:00
time.h: Sprinkle strftime format attribute
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -155,6 +155,7 @@
|
||||
# define printflike(a, b) __attribute__((__format__ (__printf__, a, b)))
|
||||
# define sysloglike(a, b) __attribute__((__format__ (__syslog__, 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 */
|
||||
|
||||
@@ -374,6 +375,7 @@
|
||||
# define printflike(a, b)
|
||||
# define sysloglike(a, b)
|
||||
# define scanflike(a, b)
|
||||
# define strftimelike(a)
|
||||
|
||||
/* The reentrant attribute informs SDCC that the function
|
||||
* must be reentrant. In this case, SDCC will store input
|
||||
@@ -504,6 +506,7 @@
|
||||
# define printflike(a, b)
|
||||
# define sysloglike(a, b)
|
||||
# define scanflike(a, b)
|
||||
# define strftimelike(a)
|
||||
|
||||
/* REVISIT: */
|
||||
|
||||
@@ -607,6 +610,7 @@
|
||||
# define printflike(a, b)
|
||||
# define sysloglike(a, b)
|
||||
# define scanflike(a, b)
|
||||
# define strftimelike(a)
|
||||
|
||||
# define FAR
|
||||
# define NEAR
|
||||
@@ -665,6 +669,7 @@
|
||||
# define printflike(a, b)
|
||||
# define sysloglike(a, b)
|
||||
# define scanflike(a, b)
|
||||
# define strftimelike(a)
|
||||
|
||||
# define FAR
|
||||
# define NEAR
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
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_r(FAR const struct tm *tp, FAR char *buf);
|
||||
|
||||
Reference in New Issue
Block a user