linux-mainline/fs/netfs
Kees Cook 58db1c3cd0
netfs: Mark __nonstring lookup tables
GCC 15's new -Wunterminated-string-initialization notices that the
character lookup tables "fscache_cache_states" and "fscache_cookie_states"
(which are not used as a C-String) need to be marked as "nonstring":

fs/netfs/fscache_cache.c:375:67: warning: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (6 chars into 5 available) [-Wunterminated-string-initialization]
  375 | static const char fscache_cache_states[NR__FSCACHE_CACHE_STATE] = "-PAEW";
      |                                                                   ^~~~~~~
fs/netfs/fscache_cookie.c:32:69: warning: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (11 chars into 10 available) [-Wunterminated-string-initialization]
   32 | static const char fscache_cookie_states[FSCACHE_COOKIE_STATE__NR] = "-LCAIFUWRD";
      |                                                                     ^~~~~~~~~~~~

Annotate the arrays.

Signed-off-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/20250416221654.work.028-kees@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-04-17 10:13:46 +02:00
..
buffered_read.c
buffered_write.c
direct_read.c netfs: Fix netfs_unbuffered_read() to return ssize_t rather than int 2025-03-19 10:04:23 +01:00
direct_write.c
fscache_cache.c netfs: Mark __nonstring lookup tables 2025-04-17 10:13:46 +02:00
fscache_cookie.c netfs: Mark __nonstring lookup tables 2025-04-17 10:13:46 +02:00
fscache_internal.h
fscache_io.c
fscache_main.c
fscache_proc.c
fscache_stats.c
fscache_volume.c
internal.h
iterator.c
Kconfig
locking.c
main.c netfs: Only create /proc/fs/netfs with CONFIG_PROC_FS 2025-04-11 15:58:18 +02:00
Makefile
misc.c
objects.c
read_collect.c
read_pgpriv2.c
read_retry.c
read_single.c
rolling_buffer.c netfs: Fix rolling_buffer_load_from_ra() to not clear mark bits 2025-03-19 10:04:22 +01:00
stats.c
write_collect.c
write_issue.c
write_retry.c