linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* selftests: mm: seal_elf.c:140:45: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[5]' [-Wformat=]
@ 2024-04-18  9:37 Naresh Kamboju
  0 siblings, 0 replies; only message in thread
From: Naresh Kamboju @ 2024-04-18  9:37 UTC (permalink / raw)
  To: open list:KERNEL SELFTEST FRAMEWORK, open list, linux-mm, lkft-triage
  Cc: Andrew Morton, Shuah Khan, Anders Roxell, Arnd Bergmann, Dan Carpenter

The Linux next building selftests with gcc-13 found these build warnings
and errors.

Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>

Build log:
---------
PATH:
selftests/mm/seal_elf

seal_elf.c: In function 'test_seal_elf':
seal_elf.c:140:45: warning: format '%s' expects argument of type 'char
*', but argument 5 has type 'char (*)[5]' [-Wformat=]
  140 |                 if (sscanf(line, "%lx-%lx %4s %*x %*x:%*x %*u
%255[^\n]",
      |                                           ~~^
      |                                             |
      |                                             char *
  141 |                         &addr_start, &addr_end, &prot,
&filename) == 4) {
      |                                                 ~~~~~
      |                                                 |
      |                                                 char (*)[5]
seal_elf.c:140:69: warning: format '%[^
   ' expects argument of type 'char *', but argument 6 has type 'char
(*)[256]' [-Wformat=]
  140 |                 if (sscanf(line, "%lx-%lx %4s %*x %*x:%*x %*u
%255[^\n]",
      |                                                               ~~~~~~^~
      |                                                                     |
      |
     char *
  141 |                         &addr_start, &addr_end, &prot,
&filename) == 4) {
      |                                                        ~~~~~~~~~
      |                                                        |
      |                                                        char (*)[256]
seal_elf.c:110:13: warning: unused variable 'size' [-Wunused-variable]
  110 |         int size = 0;
      |             ^~~~
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld:
/tmp/cczODkiZ.o: in function `test_seal_elf':
seal_elf.c:(.text+0x738): undefined reference to `sys_mprotect'
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld:
seal_elf.c:(.text+0x794): undefined reference to `sys_mprotect'
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld:
seal_elf.c:(.text+0x944): undefined reference to `sys_mprotect'
collect2: error: ld returned 1 exit status

Steps to reproduce:
---
tuxmake --runtime podman --target-arch arm64 --toolchain gcc-13 \
  --kconfig https://storage.tuxsuite.com/public/linaro/lkft/builds/2fDW3wG8BqWxf0afUI5f4wkArPi/config
\
  debugkernel dtbs dtbs-legacy headers kernel kselftest modules

Links:
 - https://storage.tuxsuite.com/public/linaro/lkft/builds/2fDW3wG8BqWxf0afUI5f4wkArPi/

--
Linaro LKFT
https://lkft.linaro.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-18  9:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-18  9:37 selftests: mm: seal_elf.c:140:45: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[5]' [-Wformat=] Naresh Kamboju

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 NNTP newsgroup(s).