diff options
author | Simon McVittie <smcv@debian.org> | 2023-02-07 11:39:29 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2023-02-07 11:54:33 +0000 |
commit | c142812f7653cd1f6e52224da8410cd09f102a4f (patch) | |
tree | e31ae092f7e6304fe0309f1202d97a24cfd828c9 | |
parent | a1a330b8720e4bc1c2154f120196372627dc7b2a (diff) | |
download | accountsservice-c142812f7653cd1f6e52224da8410cd09f102a4f.tar.gz |
Annotate varargs functions with G_GNUC_PRINTF
This lets the compiler detect and diagnose type mismatches like the one
fixed in the previous commit.
Helps: https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/109
Signed-off-by: Simon McVittie <smcv@debian.org>
-rw-r--r-- | src/daemon.c | 5 | ||||
-rw-r--r-- | src/user.c | 5 | ||||
-rw-r--r-- | src/util.h | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/daemon.c b/src/daemon.c index 81bf5ad..0fbd1d7 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -876,6 +876,11 @@ daemon_new (void) return g_steal_pointer (&daemon); } +static void throw_error (GDBusMethodInvocation *context, + gint error_code, + const gchar *format, + ...) G_GNUC_PRINTF (3, 4); + static void throw_error (GDBusMethodInvocation *context, gint error_code, @@ -1120,6 +1120,11 @@ user_set_saved (User *user, accounts_user_set_saved (ACCOUNTS_USER (user), saved); } +static void throw_error (GDBusMethodInvocation *context, + gint error_code, + const gchar *format, + ...) G_GNUC_PRINTF (3, 4); + static void throw_error (GDBusMethodInvocation *context, gint error_code, @@ -25,7 +25,7 @@ void sys_log (GDBusMethodInvocation *context, const gchar *format, - ...); + ...) G_GNUC_PRINTF (2, 3); gboolean get_caller_uid (GDBusMethodInvocation *context, gint *uid); |