Skip to content

Fix -Wsign-compare warning

Michael Catanzaro requested to merge mcatanzaro/sign-compare into master

[23/236] Compiling C object 'lib/76b5a...isc@sha/contrib_gvdb_gvdb-reader.c.o'. ../../../../Projects/epiphany/lib/contrib/gvdb/gvdb-reader.c: In function ‘gvdb_table_get_names’: ../../../../Projects/epiphany/lib/contrib/gvdb/gvdb-reader.c:428:27: warning: comparison of integer expressions of different signedness: ‘guint32’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’} [-Wsign-compare] 428 | else if (parent < n_names && names[parent] != NULL) | ^

To fix this, we have to change n_names to guint, and then also change the types of everything it's compared against. This seems to be safe since none of these should ever be negative.

Merge request reports