[libadwaita/wip/chergert-fix-format-literal] toast: propagate printf format through constructor




commit 3d1e26e993df4981ad88af092ae0fbd45bf01dde
Author: Christian Hergert <chergert redhat com>
Date:   Wed Apr 6 10:34:39 2022 -0700

    toast: propagate printf format through constructor
    
    Without the GCC printf attribute, some compilers cannot trace the origin
    of format literals across function call boundaries. This improves the
    situation so that -Werror,-Wformat-nonliteral succeeds on compilers such
    as Clang.

 src/adw-toast.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/adw-toast.h b/src/adw-toast.h
index 7eb5e8b7..17a5df34 100644
--- a/src/adw-toast.h
+++ b/src/adw-toast.h
@@ -31,7 +31,7 @@ ADW_AVAILABLE_IN_ALL
 AdwToast *adw_toast_new        (const char *title) G_GNUC_WARN_UNUSED_RESULT;
 ADW_AVAILABLE_IN_ALL
 AdwToast *adw_toast_new_format (const char *format,
-                                ...) G_GNUC_WARN_UNUSED_RESULT;
+                                ...) G_GNUC_PRINTF (1, 2) G_GNUC_WARN_UNUSED_RESULT;
 
 ADW_AVAILABLE_IN_ALL
 const char *adw_toast_get_title (AdwToast   *self);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]