public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/14] tools/nolibc: enable compiler warnings
@ 2023-08-03  7:28 Thomas Weißschuh
  2023-08-03  7:28 ` [PATCH v3 01/14] tools/nolibc: drop unused variables Thomas Weißschuh
                   ` (14 more replies)
  0 siblings, 15 replies; 20+ messages in thread
From: Thomas Weißschuh @ 2023-08-03  7:28 UTC (permalink / raw)
  To: Willy Tarreau, Shuah Khan
  Cc: linux-kselftest, linux-kernel, Yuan Tan, Zhangjin Wu,
	Thomas Weißschuh

To help the developers to avoid mistakes and keep the code smaller let's
enable compiler warnings.

I stuck with __attribute__((unused)) over __maybe_unused in
nolibc-test.c for consistency with nolibc proper.
If we want to add a define it needs to be added twice once for nolibc
proper and once for nolibc-test otherwise libc-test wouldn't build
anymore.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Changes in v3:
- Make getpagesize() return "int"
- Simplify validation of read() return value
- Don't make functions static that are to be used as breakpoints
- Drop -s from LDFLAGS
- Use proper types for read()/write() return values
- Fix unused parameter warnings in new setvbuf()
- Link to v2: https://lore.kernel.org/r/20230801-nolibc-warnings-v2-0-1ba5ca57bd9b@weissschuh.net

Changes in v2:
- Don't drop unused test helpers, mark them as __attribute__((unused))
- Make some function in nolibc-test static
- Also handle -W and -Wextra
- Link to v1: https://lore.kernel.org/r/20230731-nolibc-warnings-v1-0-74973d2a52d7@weissschuh.net

---
Thomas Weißschuh (14):
      tools/nolibc: drop unused variables
      tools/nolibc: fix return type of getpagesize()
      tools/nolibc: setvbuf: avoid unused parameter warnings
      tools/nolibc: sys: avoid implicit sign cast
      tools/nolibc: stdint: use int for size_t on 32bit
      selftests/nolibc: drop unused variables
      selftests/nolibc: mark test helpers as potentially unused
      selftests/nolibc: make functions static if possible
      selftests/nolibc: avoid unused parameter warnings
      selftests/nolibc: avoid sign-compare warnings
      selftests/nolibc: use correct return type for read() and write()
      selftests/nolibc: prevent out of bounds access in expect_vfprintf
      selftests/nolibc: don't strip nolibc-test
      selftests/nolibc: enable compiler warnings

 tools/include/nolibc/stdint.h                |   4 +
 tools/include/nolibc/stdio.h                 |   5 +-
 tools/include/nolibc/sys.h                   |   7 +-
 tools/testing/selftests/nolibc/Makefile      |   4 +-
 tools/testing/selftests/nolibc/nolibc-test.c | 111 ++++++++++++++++-----------
 5 files changed, 80 insertions(+), 51 deletions(-)
---
base-commit: bc87f9562af7b2b4cb07dcaceccfafcf05edaff8
change-id: 20230731-nolibc-warnings-c6e47284ac03

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-08-05 16:55 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03  7:28 [PATCH v3 00/14] tools/nolibc: enable compiler warnings Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 01/14] tools/nolibc: drop unused variables Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 02/14] tools/nolibc: fix return type of getpagesize() Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 03/14] tools/nolibc: setvbuf: avoid unused parameter warnings Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 04/14] tools/nolibc: sys: avoid implicit sign cast Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 05/14] tools/nolibc: stdint: use int for size_t on 32bit Thomas Weißschuh
2023-08-05 16:19   ` Willy Tarreau
2023-08-05 16:25     ` Thomas Weißschuh
2023-08-05 16:35       ` Willy Tarreau
2023-08-03  7:28 ` [PATCH v3 06/14] selftests/nolibc: drop unused variables Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 07/14] selftests/nolibc: mark test helpers as potentially unused Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 08/14] selftests/nolibc: make functions static if possible Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 09/14] selftests/nolibc: avoid unused parameter warnings Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 10/14] selftests/nolibc: avoid sign-compare warnings Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 11/14] selftests/nolibc: use correct return type for read() and write() Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 12/14] selftests/nolibc: prevent out of bounds access in expect_vfprintf Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 13/14] selftests/nolibc: don't strip nolibc-test Thomas Weißschuh
2023-08-03  7:28 ` [PATCH v3 14/14] selftests/nolibc: enable compiler warnings Thomas Weißschuh
2023-08-05 16:23   ` Willy Tarreau
2023-08-05 16:54 ` [PATCH v3 00/14] tools/nolibc: " Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox