Use function format attribute where applicable

Allow the compiler to verify the format string against the supplied
arguments.

    chage.c:239:51: warning: format not a string literal, format string not checked [-Wformat-nonliteral]
      239 |                 (void) strftime (buf, sizeof buf, format, tp);
          |                                                   ^~~~~~
This commit is contained in:
Christian Göttsche
2022-08-05 17:40:42 +02:00
committed by Serge Hallyn
parent 477c8e6f42
commit c6c8130db4
5 changed files with 7 additions and 11 deletions

View File

@@ -91,7 +91,8 @@ static int fchown_if_needed (int fdst, const struct stat *statp,
/*
* error_acl - format the error messages for the ACL and EQ libraries.
*/
static void error_acl (struct error_context *ctx, const char *fmt, ...)
format_attr(printf, 2, 3)
static void error_acl (unused struct error_context *ctx, const char *fmt, ...)
{
va_list ap;
FILE *shadow_logfd = log_get_logfd();