Fix remaining fanalyzer errors

This commit is contained in:
Cagebreak Signing Key 1 2020-05-21 13:33:32 +00:00
commit 19e1407983
3 changed files with 7 additions and 0 deletions

View file

@ -545,6 +545,8 @@ main(int argc, char *argv[]) {
wl_display_destroy_clients(server.wl_display);
end:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wanalyzer-double-free"
for(unsigned int i = 0; server.modes[i] != NULL; ++i) {
free(server.modes[i]);
}
@ -575,3 +577,4 @@ end:
return ret;
}
#pragma GCC diagnostic pop

View file

@ -11,6 +11,7 @@ add_project_arguments(
[
'-DWLR_USE_UNSTABLE',
'-Wundef',
'-fanalyzer',
'-Wno-unused-parameter',
],
language: 'c',

3
view.c
View file

@ -223,6 +223,8 @@ view_for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator,
view->impl->for_each_popup(view, iterator, data);
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wanalyzer-null-dereference"
void
view_unmap(struct cg_view *view) {
#if CG_HAS_XWAYLAND
@ -263,6 +265,7 @@ view_unmap(struct cg_view *view) {
}
}
#endif
#pragma GCC diagnostic pop
wl_list_remove(&view->link);