Skip to content

Commit 1faa70f

Browse files
committed
fix last set of warnings
1 parent d3188d4 commit 1faa70f

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

src/pluginregistry.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,19 @@ static struct plugin_instance *get_plugin_by_name(struct plugin_registry *regist
8989
return instance;
9090
}
9191

92+
// clang-format off
9293
static struct platch_obj_cb_data *get_cb_data_by_channel_locked(struct plugin_registry *registry, const char *channel) {
93-
list_for_each_entry(struct platch_obj_cb_data, data, &registry->callbacks, entry) {
94-
if (streq(data->channel, channel)) {
95-
return data;
94+
ANALYZER_SUPPRESS({
95+
list_for_each_entry(struct platch_obj_cb_data, data, &registry->callbacks, entry) {
96+
if (streq(data->channel, channel)) {
97+
return data;
98+
}
9699
}
97-
}
100+
});
98101

99102
return NULL;
100103
}
104+
// clang-format on
101105

102106
struct plugin_registry *plugin_registry_new(struct flutterpi *flutterpi) {
103107
struct plugin_registry *reg;

src/util/list.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ static inline void list_replace(struct list_head *from, struct list_head *to) {
9393
}
9494

9595
static inline void list_del(struct list_head *item) {
96-
item->prev->next = item->next;
97-
item->next->prev = item->prev;
98-
item->prev = item->next = NULL;
96+
// We need this to suppress a false positive `use-after-free` coming from pluginregistry.c.
97+
ANALYZER_SUPPRESS({
98+
item->prev->next = item->next;
99+
item->next->prev = item->prev;
100+
item->prev = item->next = NULL;
101+
});
99102
}
100103

101104
static inline void list_delinit(struct list_head *item) {

src/vulkan.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
const char *vk_strerror(VkResult result) {
66
PRAGMA_DIAGNOSTIC_PUSH
77

8-
// We want to know when we don't handle a result code,
9-
// but we don't want it to be an error.
10-
PRAGMA_DIAGNOSTIC_WARNING("-Wswitch-enum")
8+
// We'd really like to use PRAGMA_DIAGNOSTIC_WARNING for "-Wswitch-enum" here,
9+
// but CodeChecker makes it hard to distinguish between warnings and errors
10+
// and will always treat this an error.
11+
// So ignore it for now.
12+
PRAGMA_DIAGNOSTIC_IGNORED("-Wswitch-enum")
1113
switch (result) {
1214
case VK_SUCCESS: return "VK_SUCCESS";
1315
case VK_NOT_READY: return "VK_NOT_READY";

0 commit comments

Comments
 (0)