diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-09-07 11:24:16 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-09-07 10:55:43 +0000 |
commit | 145bbb40102f5d44db2877b7379f08a0993c7b57 (patch) | |
tree | 77e8d9e9a1aafbdc29cbefc9e6366b621200162c | |
parent | ba5ad78ed981c873592ac529978f4c77a7e6ee1a (diff) | |
download | ModemManager-145bbb40102f5d44db2877b7379f08a0993c7b57.tar.gz |
test,lsudev: add attribute format to println()
../test/lsudev.c: In function ‘println’:
../test/lsudev.c:68:5: warning: function ‘println’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
68 | g_string_append_vprintf (output, fmt, args);
| ^~~~~~~~~~~~~~~~~~~~~~~
-rw-r--r-- | test/lsudev.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/lsudev.c b/test/lsudev.c index 85c76f8c5..fb53c1e15 100644 --- a/test/lsudev.c +++ b/test/lsudev.c @@ -50,6 +50,8 @@ setup_signals (void) sigaction (SIGINT, &action, NULL); } +static void println (guint indent, const char *fmt, ...) __attribute__((__format__ (__printf__, 2, 3))); + static void println (guint indent, const char *fmt, ...) { @@ -90,8 +92,7 @@ dump_device_and_parent (GUdevDevice *device, guint indent) println (indent, "Action: %s", g_udev_device_get_action (device)); println (indent, "Seq Num: %lu", g_udev_device_get_seqnum (device)); println (indent, "Dev File: %s", g_udev_device_get_device_file (device)); - - println (indent, ""); + println (indent, "-----------"); println (indent, "Properties:"); /* Get longest property name length for alignment */ @@ -111,8 +112,6 @@ dump_device_and_parent (GUdevDevice *device, guint indent) println (indent + 2, "%s", propstr); } - println (indent, ""); - parent = g_udev_device_get_parent (device); if (parent) { dump_device_and_parent (parent, indent + 4); |