Skip to content

Commit

Permalink
Add format check macro to printf-style functions
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Aug 23, 2022
1 parent 1c765e9 commit 7508c9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
static const char *log_prefix;
static int noisy_abort;

static void warn(const char *restrict fmt, ...) {
static G_GNUC_PRINTF(1, 2) void warn(const char *restrict fmt, ...) {
if (log_prefix)
fprintf(stderr, "%s: ", log_prefix);
va_list ap;
Expand All @@ -45,7 +45,7 @@ static void warn(const char *restrict fmt, ...) {
va_end(ap);
}

static G_NORETURN void die(const char *restrict fmt, ...) {
static G_NORETURN G_GNUC_PRINTF(1, 2) void die(const char *restrict fmt, ...) {
if (fmt) {
if (log_prefix)
fprintf(stderr, "%s: ", log_prefix);
Expand Down

0 comments on commit 7508c9c

Please sign in to comment.