From 682af2f83fba6058eaf10244b9c174a85ea89c6c Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Mon, 28 Nov 2016 11:53:13 -0800 Subject: [PATCH] Remove 4 cppcheck suppressions reported unmatched. --- src/common.h | 2 +- src/complete.cpp | 1 - src/env_universal_common.cpp | 1 - src/parse_tree.cpp | 2 -- 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/common.h b/src/common.h index 731c8c23e..7f077bbb6 100644 --- a/src/common.h +++ b/src/common.h @@ -670,7 +670,7 @@ ssize_t read_loop(int fd, void *buff, size_t count); /// /// will print the string 'fish: Pi = 3.141', given that debug_level is 1 or higher, and that /// program_name is 'fish'. -void __attribute__((noinline)) debug(int level, const char *msg, ...); +void __attribute__((noinline)) debug(int level, const char *msg, ...) __attribute__ ((format (printf, 2, 3))); void __attribute__((noinline)) debug(int level, const wchar_t *msg, ...); /// Replace special characters with backslash escape sequences. Newline is replaced with \n, etc. diff --git a/src/complete.cpp b/src/complete.cpp index 1ed733258..34bf0ca2d 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -1372,7 +1372,6 @@ void complete(const wcstring &cmd_with_subcmds, std::vector *out_c } } - // cppcheck-suppress nullPointerRedundantCheck if (cmd_node && cmd_node->location_in_or_at_end_of_source_range(pos)) { // Complete command filename. completer.complete_cmd(current_token, use_function, use_builtin, use_command, diff --git a/src/env_universal_common.cpp b/src/env_universal_common.cpp index 08e619650..f10ceaa71 100644 --- a/src/env_universal_common.cpp +++ b/src/env_universal_common.cpp @@ -1059,7 +1059,6 @@ class universal_notifier_shmem_poller_t : public universal_notifier_t { // Read the current seed. this->poll(); - // cppcheck-suppress memleak // addr not really leaked } public: diff --git a/src/parse_tree.cpp b/src/parse_tree.cpp index effe42091..7b8f065ef 100644 --- a/src/parse_tree.cpp +++ b/src/parse_tree.cpp @@ -127,7 +127,6 @@ const wchar_t *token_type_description(parse_token_type_t type) { // This leaks memory but it should never be run unless we have a bug elsewhere in the code. const wcstring d = format_string(L"unknown_token_type_%ld", static_cast(type)); wchar_t *d2 = new wchar_t[d.size() + 1]; - // cppcheck-suppress memleak return std::wcscpy(d2, d.c_str()); } @@ -138,7 +137,6 @@ const wchar_t *keyword_description(parse_keyword_t type) { // This leaks memory but it should never be run unless we have a bug elsewhere in the code. const wcstring d = format_string(L"unknown_keyword_%ld", static_cast(type)); wchar_t *d2 = new wchar_t[d.size() + 1]; - // cppcheck-suppress memleak return std::wcscpy(d2, d.c_str()); }