linux/tools/testing/selftests/proc
Sukrut Heroorkar ab5ac789ef selftests/proc: fix string literal warning in proc-maps-race.c
This change resolves non literal string format warning invoked for
proc-maps-race.c while compiling.

proc-maps-race.c:205:17: warning: format not a string literal and no format arguments [-Wformat-security]
 205 |                 printf(text);
     |                 ^~~~~~
proc-maps-race.c:209:17: warning: format not a string literal and no format arguments [-Wformat-security]
 209 |                 printf(text);
     |                 ^~~~~~
proc-maps-race.c: In function `print_last_lines':
proc-maps-race.c:224:9: warning: format not a string literal and no format arguments [-Wformat-security]
 224 |         printf(start);
     |         ^~~~~~

Add string format specifier %s for the printf calls in both
print_first_lines() and print_last_lines() thus resolving the warnings.

The test executes fine after this change thus causing no effect to the
functional behavior of the test.

Link: https://lkml.kernel.org/r/20250804225633.841777-1-hsukrut3@gmail.com
Fixes: aadc099c48 ("selftests/proc: add verbose mode for /proc/pid/maps tearing tests")
Signed-off-by: Sukrut Heroorkar <hsukrut3@gmail.com>
Acked-by: Suren Baghdasaryan <surenb@google.com>
Cc: David Hunter <david.hunter.linux@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-08-11 23:00:59 -07:00
..
.gitignore selftests/proc: add /proc/pid/maps tearing from vma split test 2025-07-24 19:12:36 -07:00
config
fd-001-lookup.c
fd-002-posix-eq.c
fd-003-kthread.c
Makefile selftests/proc: add /proc/pid/maps tearing from vma split test 2025-07-24 19:12:36 -07:00
proc-2-is-kthread.c proc: test "Kthread:" field 2024-06-24 22:25:08 -07:00
proc-empty-vm.c selftests: proc: remove unreached code and fix build warning 2024-06-28 19:36:27 -07:00
proc-fsconfig-hidepid.c
proc-loadavg-001.c
proc-maps-race.c selftests/proc: fix string literal warning in proc-maps-race.c 2025-08-11 23:00:59 -07:00
proc-multiple-procfs.c
proc-pid-vm.c selftests/proc: add PROCMAP_QUERY ioctl tests 2024-07-12 15:52:12 -07:00
proc-self-isnt-kthread.c proc: test "Kthread:" field 2024-06-24 22:25:08 -07:00
proc-self-map-files-001.c
proc-self-map-files-002.c
proc-self-syscall.c
proc-self-wchan.c
proc-subset-pid.c
proc-tid0.c
proc-uptime-001.c selftests/proc: Assert clock_gettime(CLOCK_BOOTTIME) VS /proc/uptime monotonicity 2023-04-18 16:35:13 +02:00
proc-uptime-002.c selftests/proc: Assert clock_gettime(CLOCK_BOOTTIME) VS /proc/uptime monotonicity 2023-04-18 16:35:13 +02:00
proc-uptime.h selftests/proc: Assert clock_gettime(CLOCK_BOOTTIME) VS /proc/uptime monotonicity 2023-04-18 16:35:13 +02:00
proc.h
read.c
self.c
setns-dcache.c
setns-sysvipc.c
thread-self.c