From: Ralph Boehme Date: Tue, 20 Oct 2020 19:59:35 +0000 (+0200) Subject: vfs_gpfs: fix bogus compiler warning X-Git-Tag: samba-4.14.0rc1~301 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=da93d88e30f58d9dfa919982b0625da37c682a27;p=thirdparty%2Fsamba.git vfs_gpfs: fix bogus compiler warning The next commit adds the first call inside Samba to the VFS function SMB_VFS_FGET_DOS_ATTRIBUTES() and therefor also to vfs_gpfs_fget_dos_attributes(). No idea why gcc is generating this warning: [4127/4716] Compiling source3/modules/vfs_aio_fork.c ../../source3/modules/vfs_gpfs.c: In function ‘vfs_gpfs_fget_dos_attributes’: ../../source3/modules/vfs_gpfs.c:1728:2: error: ‘file_id’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1728 | update_stat_ex_file_id(&fsp->fsp_name->st, file_id); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated due to -Wfatal-errors. cc1: all warnings being treated as errors This change fixes the error. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 4a8418aa726..ae5e2638115 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -1819,6 +1819,7 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct vfs_handle_struct *handle, return map_nt_error_from_unix(errno); } + ZERO_STRUCT(file_id); status = vfs_gpfs_get_file_id(&iattr, &file_id); if (!NT_STATUS_IS_OK(status)) { return status;