Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Willy Tarreau <w@1wt.eu>, Shuah Khan <shuah@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	"Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH 2/3] selftests/nolibc: ignore -Wmissing-prototypes
Date: Thu, 23 Jan 2025 21:10:43 +0100	[thread overview]
Message-ID: <20250123-nolibc-prototype-v1-2-e1afc5c1999a@weissschuh.net> (raw)
In-Reply-To: <20250123-nolibc-prototype-v1-0-e1afc5c1999a@weissschuh.net>

To make sure nolibc itself is compatible with -Wmissing-prototypes the
compiler flag should be enabled when building nolibc-test.
However some of its functions are non-static to ease debugging [0],
triggering the compiler warning.

Disable the warning inside nolibc-test while still enabling it for
nolibc itself.

[0] https://lore.kernel.org/lkml/ZMjM0UPRAqoC+goY@1wt.eu/

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

---
It's a bit iffy, but I only see three possibilities:
1) Make the functions static
2) Use #pragma
3) Add dummy prototypes

1) was NACK-ed before, so I used 2)
---
 tools/testing/selftests/nolibc/nolibc-test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 0e0e3b48a8c3a6802c6989954b6f3a7c7258db43..f162793b162f9b1ec687098b9094a6d247a53e99 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -43,6 +43,8 @@
 #endif
 #endif
 
+#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+
 #include "nolibc-test-linkage.h"
 
 /* for the type of int_fast16_t and int_fast32_t, musl differs from glibc and nolibc */

-- 
2.48.1


  parent reply	other threads:[~2025-01-23 20:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-23 20:10 [PATCH 0/3] tools/nolibc: compatibility with -Wmissing-prototypes Thomas Weißschuh
2025-01-23 20:10 ` [PATCH 1/3] tools/nolibc: add prototypes for non-static functions Thomas Weißschuh
2025-01-23 20:10 ` Thomas Weißschuh [this message]
2025-01-23 20:10 ` [PATCH 3/3] selftests/nolibc: enable -Wmissing-prototypes Thomas Weißschuh
2025-01-24  6:49 ` [PATCH 0/3] tools/nolibc: compatibility with -Wmissing-prototypes Willy Tarreau

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=20250123-nolibc-prototype-v1-2-e1afc5c1999a@weissschuh.net \
    --to=linux@weissschuh.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=w@1wt.eu \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox