From 0f9de11a11644b77cc60d6ff6ac4519d2e5c29e1 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 26 Jan 2023 14:21:02 +0100 Subject: *: apply proper format string attributes So that we get warnings about broken format strings. Signed-off-by: David Lamparter --- lib/yang.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lib/yang.h') diff --git a/lib/yang.h b/lib/yang.h index d625b24f6a..8b49df5e91 100644 --- a/lib/yang.h +++ b/lib/yang.h @@ -331,7 +331,8 @@ extern void yang_dnode_get_path(const struct lyd_node *dnode, char *xpath, * Schema name of the libyang data node. */ extern const char *yang_dnode_get_schema_name(const struct lyd_node *dnode, - const char *xpath_fmt, ...); + const char *xpath_fmt, ...) + PRINTFRR(2, 3); /* * Find a libyang data node by its YANG data path. @@ -366,7 +367,8 @@ extern struct lyd_node *yang_dnode_get(const struct lyd_node *dnode, * The libyang data node if found, or NULL if not found. */ extern struct lyd_node *yang_dnode_getf(const struct lyd_node *dnode, - const char *path_fmt, ...); + const char *path_fmt, ...) + PRINTFRR(2, 3); /* * Check if a libyang data node exists. @@ -400,7 +402,7 @@ extern bool yang_dnode_exists(const struct lyd_node *dnode, const char *xpath); * true if a libyang data node was found, false otherwise. */ extern bool yang_dnode_existsf(const struct lyd_node *dnode, - const char *xpath_fmt, ...); + const char *xpath_fmt, ...) PRINTFRR(2, 3); /* * Iterate over all libyang data nodes that satisfy an XPath query. @@ -422,7 +424,7 @@ extern bool yang_dnode_existsf(const struct lyd_node *dnode, */ void yang_dnode_iterate(yang_dnode_iter_cb cb, void *arg, const struct lyd_node *dnode, const char *xpath_fmt, - ...); + ...) PRINTFRR(4, 5); /* * Check if the libyang data node contains a default value. Non-presence @@ -459,7 +461,7 @@ extern bool yang_dnode_is_default(const struct lyd_node *dnode, * true if the data node contains the default value, false otherwise. */ extern bool yang_dnode_is_defaultf(const struct lyd_node *dnode, - const char *xpath_fmt, ...); + const char *xpath_fmt, ...) PRINTFRR(2, 3); /* * Check if the libyang data node and all of its children contain default @@ -566,7 +568,8 @@ extern struct list *yang_data_list_new(void); * Pointer to yang_data if found, NULL otherwise. */ extern struct yang_data *yang_data_list_find(const struct list *list, - const char *xpath_fmt, ...); + const char *xpath_fmt, ...) + PRINTFRR(2, 3); /* * Create and set up a libyang context (for use by the translator) -- cgit v1.2.3