Skip to content

Commit

Permalink
Add suppression macro for '-Wformat-nonliteral'.
Browse files Browse the repository at this point in the history
  • Loading branch information
besser82 committed Oct 25, 2018
1 parent 89d7468 commit 4c5ee10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions crypt-port.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
# define ARG_UNUSED(x) x
#endif

/* Suppression of format-string-is-not-a-string-literal warnings. */
#if defined __GNUC__ && __GNUC__ >= 3
# define PRINTF_FMT(x,y) __attribute__ ((__format__ (__printf__, x, y)))
#else
# define PRINTF_FMT(x,y)
#endif

/* C99 Static array indices in function parameter declarations. Syntax
such as: void bar(int myArray[static 10]); is allowed in C99, but
not all compiler support it properly. Define MIN_SIZE appropriately
Expand Down
2 changes: 1 addition & 1 deletion crypt-tune-costs.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ write_config (void)
}
}

static NORETURN
static NORETURN PRINTF_FMT(1,0)
print_usage (const char *errmsg, ...)
{
FILE *dest;
Expand Down

0 comments on commit 4c5ee10

Please sign in to comment.