From b90809d5f045de0532047c232f58eeb3965c04d5 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 17 Nov 2020 15:46:24 +0900 Subject: [PATCH] stdio.h: Sprinkle scanflike --- include/stdio.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/stdio.h b/include/stdio.h index 922dde8ee9..a79a0071eb 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -148,7 +148,8 @@ int fputs(FAR const IPTR char *s, FAR FILE *stream); size_t fread(FAR void *ptr, size_t size, size_t n_items, FAR FILE *stream); FAR FILE *freopen(FAR const char *path, FAR const char *mode, FAR FILE *stream); -int fscanf(FAR FILE *stream, FAR const IPTR char *fmt, ...); +int fscanf(FAR FILE *stream, FAR const IPTR char *fmt, ...) + scanflike(2, 3); int fseek(FAR FILE *stream, long int offset, int whence); int fseeko(FAR FILE *stream, off_t offset, int whence); int fsetpos(FAR FILE *stream, FAR fpos_t *pos); @@ -186,21 +187,24 @@ int asprintf(FAR char **ptr, FAR const IPTR char *fmt, ...) printflike(2, 3); int snprintf(FAR char *buf, size_t size, FAR const IPTR char *fmt, ...) printflike(3, 4); -int sscanf(FAR const char *buf, FAR const IPTR char *fmt, ...); +int sscanf(FAR const char *buf, FAR const IPTR char *fmt, ...) + scanflike(2, 3); -int scanf(FAR const IPTR char *fmt, ...); +int scanf(FAR const IPTR char *fmt, ...) scanflike(1, 2); int vasprintf(FAR char **ptr, FAR const IPTR char *fmt, va_list ap) printflike(2, 0); int vfprintf(FAR FILE *stream, FAR const IPTR char *fmt, va_list ap) printflike(2, 0); -int vfscanf(FAR FILE *stream, FAR const IPTR char *fmt, va_list ap); +int vfscanf(FAR FILE *stream, FAR const IPTR char *fmt, va_list ap) + scanflike(2, 0); int vprintf(FAR const IPTR char *fmt, va_list ap) printflike(1, 0); -int vscanf(FAR const IPTR char *fmt, va_list ap); +int vscanf(FAR const IPTR char *fmt, va_list ap) scanflike(1, 0); int vsnprintf(FAR char *buf, size_t size, FAR const IPTR char *fmt, va_list ap) printflike(3, 0); int vsprintf(FAR char *buf, FAR const IPTR char *fmt, va_list ap) printflike(2, 0); -int vsscanf(FAR const char *buf, FAR const IPTR char *fmt, va_list ap); +int vsscanf(FAR const char *buf, FAR const IPTR char *fmt, va_list ap) + scanflike(2, 0); /* Operations on file descriptors including: *