Skip to content

gstrfuncs: use gsize type internally for strv functions

Thomas Haller requested to merge thaller/glib:th/gstrv-use-gsize into master

In C, the proper type for a heap allocate structure is size_t/gsize. That means, no valid (heap allocated) pointer will ever contain more bytes than size_t can represent.

Hence, this integer type should also be used when operating on data like a strv array. Adjust some internal uses to use gsize instead of gint/guint.

Note that g_strv_length() returns a value of type guint. So this API cannot be used on string arrays longer of arbitrary size. But that is not fixable.


There are of course many similar "issues" in glib. I think, they should be slowly addressed (where possible and where concerning implementation only).

Merge request reports