From b303486bf1b812dd99f48a7bbb81838d658f7e03 Mon Sep 17 00:00:00 2001 From: Christian Göttsche Date: Thu, 1 Oct 2020 10:36:41 +0200 Subject: Add missing format function attributes and enable -Wmissing-format-attribute Exported functions already have these attributes, add them to other functions. This enables compilers to find format specifier mismatches, like: foo_print("Hello %d", "world") * m4/warn_lang_flags.m4 (gl_WARN_ADD): Add -Wmissing-format-attribute. * conf/pam_conv1/Makefile.am (AM_CFLAGS): Add -I$(top_srcdir)/libpam/include. * conf/pam_conv1/pam_conv_y.y: Include . (yyerror): Add printf format attribute. * modules/pam_pwhistory/opasswd.c (helper_log_err): Likewise. * modules/pam_rootok/pam_rootok.c (log_callback): Likewise. * modules/pam_tally/pam_tally.c (tally_log): Likewise. * modules/pam_tally2/pam_tally2.c (tally_log): Likewise. * modules/pam_unix/passverify.c (helper_log_err): Likewise. --- modules/pam_pwhistory/opasswd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/pam_pwhistory') diff --git a/modules/pam_pwhistory/opasswd.c b/modules/pam_pwhistory/opasswd.c index ac10f691..40296d59 100644 --- a/modules/pam_pwhistory/opasswd.c +++ b/modules/pam_pwhistory/opasswd.c @@ -89,6 +89,7 @@ typedef struct { } opwd; #ifdef HELPER_COMPILE +PAM_FORMAT((printf, 2, 3)) void helper_log_err(int err, const char *format, ...) { -- cgit v1.2.3