Skip to content

Commit

Permalink
Refactor: libs: Remove existing cppcheck suppressions.
Browse files Browse the repository at this point in the history
cppcheck runs just fine for me without these, though it's possible a
different version of cppcheck would still require them.
  • Loading branch information
clumens committed Feb 17, 2025
1 parent 77a5fca commit e636645
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 12 deletions.
2 changes: 0 additions & 2 deletions include/crm/common/io_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ void pcmk__close_fds_in_child(bool);
static inline void
pcmk__open_devnull(int flags)
{
// Static analysis clutter
// cppcheck-suppress leakReturnValNotUsed
(void) open("/dev/null", flags);
}

Expand Down
2 changes: 0 additions & 2 deletions lib/cluster/cpg.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,8 +996,6 @@ send_cpg_text(const char *data, const pcmk__node_status_t *node,
msg->compressed_size = new_size;

} else {
// cppcheck seems not to understand the abort logic in pcmk__realloc
// cppcheck-suppress memleak
msg = pcmk__realloc(msg, msg->header.size);
memcpy(msg->data, data, msg->size);
}
Expand Down
2 changes: 0 additions & 2 deletions lib/common/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ pcmk__build_arg_context(pcmk__common_args_t *common_args, const char *fmts,
}

// main_group is now owned by context, we don't free it here
// cppcheck-suppress memleak
return context;
}

Expand Down Expand Up @@ -139,7 +138,6 @@ pcmk__add_arg_group(GOptionContext *context, const char *name,
g_option_group_add_entries(group, entries);
g_option_context_add_group(context, group);
// group is now owned by context, we don't free it here
// cppcheck-suppress memleak
}

static gchar *
Expand Down
2 changes: 0 additions & 2 deletions lib/common/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ pcmk__build_path(const char *path_c, mode_t mode)
int rc = pcmk_rc_ok;
char *path = strdup(path_c);

// cppcheck seems not to understand the abort logic in CRM_CHECK
// cppcheck-suppress memleak
CRM_CHECK(path != NULL, return -ENOMEM);
for (len = strlen(path); offset < len; offset++) {
if (path[offset] == '/') {
Expand Down
2 changes: 0 additions & 2 deletions lib/common/remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,6 @@ connect_socket_retry(int sock, const struct sockaddr *addr, socklen_t addrlen,
*timer_id = timer;
}

// timer callback should be taking care of cb_data
// cppcheck-suppress memleak
return pcmk_rc_ok;
}

Expand Down
2 changes: 0 additions & 2 deletions lib/common/xml_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ decompress_file(const char *filename)
goto done;
}

// cppcheck seems not to understand the abort-logic in pcmk__realloc
// cppcheck-suppress memleak
do {
int read_len = 0;

Expand Down

0 comments on commit e636645

Please sign in to comment.