From: Douglas Bagnall Date: Tue, 9 Jan 2018 11:08:01 +0000 (+1300) Subject: vfs_fruit: initialise bandsize to please a compiler X-Git-Tag: talloc-2.1.11~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=502ab53d4a543c0d12072727fbfe7313e0acb26e;p=thirdparty%2Fsamba.git vfs_fruit: initialise bandsize to please a compiler GCC on a Ubuntu 16.04 instance said: [3174/4240] Compiling source3/modules/vfs_cap.c In file included from ../source3/include/includes.h:301:0, from ../source3/modules/vfs_fruit.c:20: ../source3/modules/vfs_fruit.c: In function ‘fruit_disk_free’: ../source3/../lib/util/debug.h:217:7: error: ‘bandsize’ may be used uninitialized in this function [-Werror=maybe-uninitialized] && (dbgtext body) ) ^ ../source3/modules/vfs_fruit.c:6302:9: note: ‘bandsize’ was declared here size_t bandsize; ^ [3175/4240] Compiling source3/modules/vfs_expand_msdfs.c [3176/4240] Compiling source3/modules/vfs_shadow_copy.c [3177/4240] Compiling source3/modules/vfs_shadow_copy2.c cc1: all warnings being treated as errors Waf: Leaving directory /home/ubuntu/autobuild/b17854/samba-o3/bin' Build failed: -> task failed (err #1): {task: cc vfs_fruit.c -> vfs_fruit_25.o} make: *** [all] Error 1 As far as I can tell, it is wrong, and the bandsize variable never gets passed uninititalised to DEBUG. Signed-off-by: Douglas Bagnall Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 9533da4a5f8..40ee2553a12 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -6392,7 +6392,7 @@ static bool fruit_tmsize_do_dirent(vfs_handle_struct *handle, bool ok; char *p = NULL; size_t sparsebundle_strlen = strlen("sparsebundle"); - size_t bandsize; + size_t bandsize = 0; size_t nbands; double tm_size;