lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230801-nolibc-warnings-v2-6-1ba5ca57bd9b@weissschuh.net>
Date:   Tue, 01 Aug 2023 07:30:13 +0200
From:   Thomas Weißschuh <linux@...ssschuh.net>
To:     Willy Tarreau <w@....eu>, Shuah Khan <shuah@...nel.org>
Cc:     linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
        Yuan Tan <tanyuan@...ylab.org>,
        Zhangjin Wu <falcon@...ylab.org>,
        Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH v2 06/10] selftests/nolibc: make functions static if
 possible

This allows the compiler to generate warnings if they go unused.

Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
---
 tools/testing/selftests/nolibc/nolibc-test.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 1555759bb164..53a3773c7790 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -80,7 +80,7 @@ char *itoa(int i)
 /* returns the error name (e.g. "ENOENT") for common errors, "SUCCESS" for 0,
  * or the decimal value for less common ones.
  */
-const char *errorname(int err)
+static const char *errorname(int err)
 {
 	switch (err) {
 	case 0: return "SUCCESS";
@@ -593,7 +593,7 @@ int expect_strne(const char *expr, int llen, const char *cmp)
 #define CASE_TEST(name) \
 	case __LINE__: llen += printf("%d %s", test, #name);
 
-int run_startup(int min, int max)
+static int run_startup(int min, int max)
 {
 	int test;
 	int ret = 0;
@@ -640,7 +640,7 @@ int run_startup(int min, int max)
 
 
 /* used by some syscall tests below */
-int test_getdents64(const char *dir)
+static int test_getdents64(const char *dir)
 {
 	char buffer[4096];
 	int fd, ret;
@@ -734,7 +734,7 @@ static int test_stat_timestamps(void)
 	return 0;
 }
 
-int test_mmap_munmap(void)
+static int test_mmap_munmap(void)
 {
 	int ret, fd, i;
 	void *mem;
@@ -796,7 +796,7 @@ int test_mmap_munmap(void)
 /* Run syscall tests between IDs <min> and <max>.
  * Return 0 on success, non-zero on failure.
  */
-int run_syscall(int min, int max)
+static int run_syscall(int min, int max)
 {
 	struct timeval tv;
 	struct timezone tz;
@@ -907,7 +907,7 @@ int run_syscall(int min, int max)
 	return ret;
 }
 
-int run_stdlib(int min, int max)
+static int run_stdlib(int min, int max)
 {
 	int test;
 	int ret = 0;
@@ -1141,7 +1141,7 @@ static int run_protection(int min, int max)
 }
 
 /* prepare what needs to be prepared for pid 1 (stdio, /dev, /proc, etc) */
-int prepare(void)
+static int prepare(void)
 {
 	struct stat stat_buf;
 
@@ -1208,7 +1208,7 @@ static const struct test test_names[] = {
 	{ 0 }
 };
 
-int is_setting_valid(char *test)
+static int is_setting_valid(char *test)
 {
 	int idx, len, test_len, valid = 0;
 	char delimiter;

-- 
2.41.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ