From 3ff911afaac15759a2d2d4af91c8bc1251a96c3e Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Thu, 27 Aug 2020 14:26:20 +0200 Subject: [PATCH] Fixing signedness warning in glib/gfileutils.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glib/gfileutils.c: In function ‘write_to_file’: glib/gfileutils.c:1176:19: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare] 1176 | g_assert (s <= length); | ^~ glib/gmacros.h:939:25: note: in definition of macro ‘G_LIKELY’ 939 | #define G_LIKELY(expr) (expr) | ^~~~ glib/gfileutils.c:1176:7: note: in expansion of macro ‘g_assert’ 1176 | g_assert (s <= length); | ^~~~~~~~ Related to issue #1735 (Get back to a -werror build) --- glib/gfileutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gfileutils.c b/glib/gfileutils.c index f0799e212..acf57b3a1 100644 --- a/glib/gfileutils.c +++ b/glib/gfileutils.c @@ -1106,7 +1106,7 @@ write_to_temp_file (const gchar *contents, goto out; } - g_assert (s <= length); + g_assert ((gsize) s <= length); contents += s; length -= s;