HomeFreeBSD

Fix gcc compiler warning, dsl_pool_create()

Description

Fix gcc compiler warning, dsl_pool_create()

When compiling ZFS in user space gcc-4.6.0 correctly identifies
the variable 'os' as being set but never used. This generates a
warning and a build failure when using --enable-debug. However,
the code is correct we only want to use 'os' for the kernel space
builds. To suppress the warning the call was wrapped with a
VERIFY() which has the nice side effect of ensuring the 'os'
actually never is NULL. This was observed under Fedora 15.

module/zfs/dsl_pool.c: In function ‘dsl_pool_create’:
module/zfs/dsl_pool.c:229:12: error: variable ‘os’ set but not used
[-Werror=unused-but-set-variable]

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Apr 18 2011, 11:27 PM
Parents
rGe30c0ada6d01: Linux 2.6.39 compat, invalidate_inodes()
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG0fe3d820f5be: Fix gcc compiler warning, dsl_pool_create() (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Apr 19 2011, 4:04 PM