libctf: fix testsuite bugs revealed by -Wall

Most of these are harmless, but some of the type confusions and especially
a missing ctf_strerror() on an error path were actual bugs that could
have resulted in test failures crashing rather than printing an error
message.

libctf/
	* testsuite/libctf-lookup/enumerator-iteration.c: Fix type
        confusion, signedness confusion and a missing ctf_errmsg().
	* testsuite/libctf-regression/libctf-repeat-cu-main.c: Return 0 from
        the test function.
	* testsuite/libctf-regression/open-error-free.c: Fix signedness
        confusion.
	* testsuite/libctf-regression/zrewrite.c: Remove unused label.
This commit is contained in:
Nick Alcock
2024-06-19 14:06:26 +01:00
parent ea4e03c0a9
commit b84ffc176d
4 changed files with 9 additions and 13 deletions

View File

@@ -143,7 +143,7 @@ int main (void)
failure after we corrupt it: the leak is only observable if the dict gets
malloced, which only happens after that point.) */
if ((written = ctf_write_mem (fp, &written_size, (size_t) -1)) == NULL)
if ((written = (char *) ctf_write_mem (fp, &written_size, (size_t) -1)) == NULL)
goto write_err;
ctf_dict_close (fp);