girparser: Silence a scan-build NULL pointer dereference warning

It’s very obviously a false positive, as `str` has been added to on the
previous line, so can’t be `(void *) 0`. Not sure what scan-build is
thinking.

I’d rather not have this assertion (it doesn’t help the programmer’s
understanding of the code), but I would also rather have scan-build
running with no warnings so that it can helpfully catch newly-introduced
errors in future.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #1767
This commit is contained in:
Philip Withnall 2024-04-12 15:54:23 +01:00
parent d2f5cd4153
commit f1d5a71bbc
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -670,6 +670,9 @@ parse_type_internal (GIIrModule *module,
type->is_pointer = TRUE;
str += strlen ("Error");
/* Silence a scan-build false positive */
g_assert (str != NULL);
if (*str == '<')
{
char *tmp, *end;