From 03514b01109e0a6ef4eee4914ba7442c380fa6b4 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 18 Apr 2011 16:44:22 -0700 Subject: [PATCH] Fix gcc compiler warning, parse_option() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compiling ZFS in user space gcc-4.6.0 correctly identifies the variable 'value' as being set but never used. This generates a warning and a build failure when using --enable-debug. Once again this is correct but I'm reluctant to remove 'value' because we are breaking the string in to name/value pairs. While it is not used now there's a good chance it will be soon and I'd rather not have to reinvent this. To suppress the warning with just as a VERIFY(). This was observed under Fedora 15. cmd/mount_zfs/mount_zfs.c: In function ‘parse_option’: cmd/mount_zfs/mount_zfs.c:112:21: error: variable ‘value’ set but not used [-Werror=unused-but-set-variable] --- cmd/mount_zfs/mount_zfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c index aff9e1003..c38ba51c3 100644 --- a/cmd/mount_zfs/mount_zfs.c +++ b/cmd/mount_zfs/mount_zfs.c @@ -120,6 +120,7 @@ parse_option(char *mntopt, unsigned long *mntflags, if (*ptr == '=') { *ptr = '\0'; value = ptr+1; + VERIFY3P(value, !=, NULL); break; } }