From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 6/6] cppcheck: Add suppressions for "logically" exported functions
Date: Wed, 5 Mar 2025 17:15:08 +1100 [thread overview]
Message-ID: <20250305061508.1699713-7-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20250305061508.1699713-1-david@gibson.dropbear.id.au>
We have some functions in our headers which are definitely there on
purpose. However, they're not yet used outside the files in which they're
defined. That causes sufficiently recent cppcheck versions (2.17) to
complain they should be static.
Suppress the errors for these "logically" exported functions.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
iov.c | 1 +
log.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/iov.c b/iov.c
index 3b122726..8c63b7ea 100644
--- a/iov.c
+++ b/iov.c
@@ -203,6 +203,7 @@ size_t iov_tail_size(struct iov_tail *tail)
* overruns the IO vector, is not contiguous or doesn't have the
* requested alignment.
*/
+/* cppcheck-suppress [staticFunction,unmatchedSuppression] */
void *iov_peek_header_(struct iov_tail *tail, size_t len, size_t align)
{
char *p;
diff --git a/log.c b/log.c
index 6eda4c4c..d40d7ae2 100644
--- a/log.c
+++ b/log.c
@@ -281,6 +281,7 @@ static void passt_vsyslog(bool newline, int pri, const char *format, va_list ap)
* @format: Message
* @ap: Variable argument list
*/
+/* cppcheck-suppress [staticFunction,unmatchedSuppression] */
void vlogmsg(bool newline, bool cont, int pri, const char *format, va_list ap)
{
bool debug_print = (log_mask & LOG_MASK(LOG_DEBUG)) && log_file == -1;
--
@@ -281,6 +281,7 @@ static void passt_vsyslog(bool newline, int pri, const char *format, va_list ap)
* @format: Message
* @ap: Variable argument list
*/
+/* cppcheck-suppress [staticFunction,unmatchedSuppression] */
void vlogmsg(bool newline, bool cont, int pri, const char *format, va_list ap)
{
bool debug_print = (log_mask & LOG_MASK(LOG_DEBUG)) && log_file == -1;
--
2.48.1
next prev parent reply other threads:[~2025-03-05 6:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 6:15 [PATCH 0/6] Deal with a bunch of staticFunction warnings from cppcheck 2.17 David Gibson
2025-03-05 6:15 ` [PATCH 1/6] treewide: Mark assorted functions static David Gibson
2025-03-05 6:15 ` [PATCH 2/6] log: Don't export passt_vsyslog() David Gibson
2025-03-05 6:15 ` [PATCH 3/6] checksum: Don't export various functions David Gibson
2025-03-05 6:15 ` [PATCH 4/6] tcp: Don't export tcp_update_csum() David Gibson
2025-03-05 6:15 ` [PATCH 5/6] vhost_user: Don't export several functions David Gibson
2025-03-05 6:15 ` David Gibson [this message]
2025-03-07 6:30 ` [PATCH 0/6] Deal with a bunch of staticFunction warnings from cppcheck 2.17 Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250305061508.1699713-7-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).