mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 04:33:00 +02:00
confd: Use printf attribute on relevant helpers
This let's the compiler catch format-specifier-to-argument mismatches.
This commit is contained in:
committed by
Joachim Wiberg
parent
31d5dbda8c
commit
3ae4e1d9ca
@@ -3,9 +3,12 @@
|
||||
#ifndef CONFD_HELPERS_H_
|
||||
#define CONFD_HELPERS_H_
|
||||
|
||||
FILE *popenf(const char *type, const char *cmdf, ...);
|
||||
FILE *popenf(const char *type, const char *cmdf, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
int writedf(int value, const char *fmt, ...);
|
||||
int writesf(const char *str, const char *fmt, ...);
|
||||
int writedf(int value, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
int writesf(const char *str, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
#endif /* CONFD_HELPERS_H_ */
|
||||
|
||||
@@ -11,9 +11,14 @@
|
||||
int srx_set_item(sr_session_ctx_t *session, const sr_val_t *val, sr_edit_options_t opts,
|
||||
const char *fmt, ...) __attribute__ ((format (printf, 4, 5)));
|
||||
|
||||
char *srx_get_str (sr_session_ctx_t *session, const char *fmt, ...);
|
||||
int srx_get_int (sr_session_ctx_t *session, int *result, sr_val_type_t type, const char *fmt, ...);
|
||||
int srx_get_bool (sr_session_ctx_t *session, const char *fmt, ...);
|
||||
int srx_enabled (sr_session_ctx_t *session, const char *fmt, ...);
|
||||
char *srx_get_str (sr_session_ctx_t *session, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
int srx_get_int (sr_session_ctx_t *session, int *result, sr_val_type_t type, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 4, 5)));
|
||||
int srx_get_bool (sr_session_ctx_t *session, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
int srx_enabled (sr_session_ctx_t *session, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
#endif /* CONFD_SRX_VAL_H_ */
|
||||
|
||||
Reference in New Issue
Block a user