Whamcloud - gitweb
LU-17504 build: fix gcc-13 [-Werror=stringop-overread] error 34/54834/5
authorShaun Tancheff <shaun.tancheff@hpe.com>
Thu, 25 Apr 2024 17:57:36 +0000 (00:57 +0700)
committerShaun Tancheff <shaun.tancheff@hpe.com>
Fri, 26 Apr 2024 15:54:56 +0000 (22:54 +0700)
commit787b45323742a00e262334ba6dfa8c7aff80bdac
treecd66d559b39f9bdaaf9020e35f78a23f6cd9d573
parent617e7a25b12e0cdb865188414b6d1206eedec69a
LU-17504 build: fix gcc-13 [-Werror=stringop-overread] error

This patch fixes the following [-Werror=stringop-overread] and
[-Werror=attribute-warning] errors detected by gcc 13:

lustre/mgc/mgc_request.c:190:21: error: 'strcmp' reading 1 or
more bytes from a region of size 0 [-Werror=stringop-overread]
  190 | if (strcmp(logname, cld->cld_logname) == 0) {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In function 'fortify_memcpy_chk',
    inlined from 'class_handle_ioctl' at
/root/lustre-release/lustre/obdclass/class_obd.c:381:3:
include/linux/fortify-string.h:528:25: error:
call to '__write_overflow_field' declared with attribute warning:
detected write beyond size of field (1st parameter);
maybe use struct_group()? [-Werror=attribute-warning]
  528 |  __write_overflow_field(p_size_field, size);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Jian Yu <yujian@whamcloud.com>
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I59f5a88b4cd64c9f4e67e568546baada371543b1
17 files changed:
libcfs/include/libcfs/libcfs_hash.h
libcfs/libcfs/hash.c
lnet/lnet/config.c
lnet/selftest/module.c
lustre/include/lustre_quota.h
lustre/include/lustre_sec.h
lustre/include/obd_class.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/include/uapi/linux/lustre/lustre_ioctl.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/lfsck/lfsck_internal.h
lustre/mgc/mgc_request.c
lustre/obdclass/class_obd.c
lustre/obdclass/dt_object.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c