Skip to content

Commit

Permalink
libselinux/man: add format attribute for set_matchpathcon_printf(3)
Browse files Browse the repository at this point in the history
The parameter for set_matchpathcon_printf(3) is a function pointer that
takes a format string with variable arguments.  Add a GNU printf
function attribute, if supported, to enable compilers checking for
format string inconsistencies.

Signed-off-by: Christian Göttsche <[email protected]>
Acked-by: James Carter <[email protected]>
  • Loading branch information
cgzones authored and jwcart2 committed May 1, 2024
1 parent c476389 commit d370cbf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libselinux/include/selinux/selinux.h
Expand Up @@ -443,7 +443,11 @@ extern void selinux_flush_class_cache(void);
/* Set the function used by matchpathcon_init when displaying
errors about the file_contexts configuration. If not set,
then this defaults to fprintf(stderr, fmt, ...). */
extern void set_matchpathcon_printf(void (*f) (const char *fmt, ...));
extern void set_matchpathcon_printf(void
#ifdef __GNUC__
__attribute__ ((format(printf, 1, 2)))
#endif
(*f) (const char *fmt, ...));

/* Set the function used by matchpathcon_init when checking the
validity of a context in the file contexts configuration. If not set,
Expand Down

0 comments on commit d370cbf

Please sign in to comment.