diff options
author | mav <mav@FreeBSD.org> | 2018-02-18 00:26:00 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2018-02-18 00:26:00 +0000 |
commit | 85c2ffa5dc93e7798d21f93c5719282a0e7ba605 (patch) | |
tree | 381d065592ce74424f3acc63cf31f9b6df62ec50 /cddl/contrib | |
parent | 59e2d7e678358a8c92a7f9180315267fa5eeda83 (diff) | |
download | FreeBSD-src-85c2ffa5dc93e7798d21f93c5719282a0e7ba605.zip FreeBSD-src-85c2ffa5dc93e7798d21f93c5719282a0e7ba605.tar.gz |
MFC r328252: MFV r328251: 8652 Tautological comparisons with ZPROP_INVAL
illumos/illumos-gate@4ae5f5f06c6c2d1db8167480f7d9e3b5378ba2f2
https://www.illumos.org/issues/8652:
Clang and GCC prefer to use unsigned ints to store enums. With Clang, that
causes tautological comparison warnings when comparing a zfs_prop_t or
zpool_prop_t variable to the macro ZPROP_INVAL. It's likely that error
handling code is being silently removed as a result.
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Alan Somers <asomers@gmail.com>
Diffstat (limited to 'cddl/contrib')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 2 | ||||
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index 99be598..06c2e25 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -441,7 +441,7 @@ add_prop_list(const char *propname, char *propval, nvlist_t **props, * feature@ properties and version should not be specified * at the same time. */ - if ((prop == ZPROP_INVAL && zpool_prop_feature(propname) && + if ((prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname) && nvlist_exists(proplist, vname)) || (prop == ZPOOL_PROP_VERSION && prop_list_contains_feature(proplist))) { diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c index 2be0191..962b3ff2 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c @@ -445,7 +445,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname, const char *propname = nvpair_name(elem); prop = zpool_name_to_prop(propname); - if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) { + if (prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname)) { int err; char *fname = strchr(propname, '@') + 1; @@ -484,7 +484,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname, /* * Make sure this property is valid and applies to this type. */ - if (prop == ZPROP_INVAL) { + if (prop == ZPOOL_PROP_INVAL) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "invalid property '%s'"), propname); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); |