selftests: mm: seal_elf.c:140:45: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[5]' [-Wformat=]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Reported-by: Linux Kernel Functional Testing <lkft@xxxxxxxxxx>

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




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux