Enable more printf format attributes

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-04-14 08:32:18 +02:00
parent a0820c7f20
commit 6a21ac55ad
3 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -65,7 +65,7 @@ struct fstab *getfsent (void);
char *console (void);
void console_init (void);
ssize_t cprintf (const char *fmt, ...);
ssize_t cprintf (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
char *strip_line (char *line);
@@ -79,7 +79,7 @@ void stty (int fd, speed_t speed);
void print_banner (const char *heading);
void printv (const char *fmt, va_list ap);
void print (int action, const char *fmt, ...);
void print (int action, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
void print_desc (char *action, char *desc);
int print_result (int fail);
@@ -97,7 +97,7 @@ int in_container (void);
int complete (char *cmd, int pid);
int run (char *cmd, char *log);
int run_interactive (char *cmd, char *fmt, ...);
int run_interactive (char *cmd, char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
int exec_runtask (char *cmd, char *args[]);
pid_t run_getty (char *tty, char *cmd, char *args[], int noclear, int nowait, struct rlimit rlimit[]);
pid_t run_sh (char *tty, int noclear, int nowait, struct rlimit rlimit[]);
+1 -1
View File
@@ -34,7 +34,7 @@ extern int heading; /* initctl -t */
extern int verbose; /* initctl -v */
extern int plain; /* initctl -p */
extern void print_header(const char *fmt, ...);
extern void print_header(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
#endif /* FINIT_INITCTL_H_ */
+4 -4
View File
@@ -54,9 +54,9 @@ extern char *prognm;
char *progname (char *arg0);
char *str (char *fmt, ...);
int fnread (char *buf, size_t len, char *fmt, ...);
int fnwrite (char *value, char *fmt, ...);
char *str (char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
int fnread (char *buf, size_t len, char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
int fnwrite (char *value, char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
int fngetint (char *path, int *val);
int strtobytes (char *arg);
@@ -85,7 +85,7 @@ int ttcooked (void);
#define ttcooked() 0
#endif
static inline void dbg(char *fmt, ...)
static __attribute__ ((format (printf, 1, 2))) inline void dbg(char *fmt, ...)
{
va_list ap;