From 33bfae70acf76dcca6cfdfe21ca4c0236c40e63e Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Thu, 10 Sep 2020 18:05:40 +0200 Subject: [PATCH 1/4] Fix signedness problem in glib/gutils.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glib/gutils.c:998:26: error: comparison of integer expressions of different signedness: ‘glong’ {aka ‘long int’} and ‘long unsigned int’ 998 | if (max > 0 && max <= G_MAXSIZE - 1) | ^~ --- glib/gutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gutils.c b/glib/gutils.c index c5aef47fa..aff3ed442 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -995,7 +995,7 @@ g_get_host_name (void) #ifdef _SC_HOST_NAME_MAX max = sysconf (_SC_HOST_NAME_MAX); - if (max > 0 && max <= G_MAXSIZE - 1) + if (max > 0 && (gsize) max <= G_MAXSIZE - 1) size = (gsize) max + 1; else #ifdef HOST_NAME_MAX From d49586cfa3f06b456aee6cbd4d2cd357376d952f Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Thu, 10 Sep 2020 18:10:06 +0200 Subject: [PATCH 2/4] Fix signedness error in glib/gspawn.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glib/gspawn.c:2252:16: error: comparison of integer expressions of different signedness: ‘int’ and ‘gsize’ {aka ‘long unsigned int’} 2252 | if (argc + 2 > argv_buffer_len) | ^ --- glib/gspawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gspawn.c b/glib/gspawn.c index 80ef669f8..c37ac7c84 100644 --- a/glib/gspawn.c +++ b/glib/gspawn.c @@ -2244,7 +2244,7 @@ script_execute (const gchar *file, gchar **envp) { /* Count the arguments. */ - int argc = 0; + gsize argc = 0; while (argv[argc]) ++argc; From 33148e6bc39601e8b06934d359fed663e79f9d47 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Thu, 10 Sep 2020 18:12:45 +0200 Subject: [PATCH 3/4] Fix a signedness problem in glib/tests/collate.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glib/tests/collate.c:300:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’ 300 | for (i = 0; i < G_N_ELEMENTS (test); i++) | ^ --- glib/tests/collate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/tests/collate.c b/glib/tests/collate.c index 017f247b1..bd9ea234f 100644 --- a/glib/tests/collate.c +++ b/glib/tests/collate.c @@ -271,7 +271,7 @@ int main (int argc, char *argv[]) { gchar *path; - gint i; + guint i; const gchar *locale; CollateTest test[3]; From 16773d27027ab29fde2a50467174bbff60d8ac76 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Thu, 10 Sep 2020 18:35:20 +0200 Subject: [PATCH 4/4] Fix a signedness problem in glib/tests/date.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glib/tests/date.c:778:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’ 778 | for (i = 0; i < G_N_ELEMENTS (check_years); i++) | ^ --- glib/tests/date.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/tests/date.c b/glib/tests/date.c index 92f0a7f6e..e49ec3419 100644 --- a/glib/tests/date.c +++ b/glib/tests/date.c @@ -737,7 +737,7 @@ int main (int argc, char** argv) { gchar *path; - gint i; + gsize i; /* Try to get all the leap year cases. */ int check_years[] = {