aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTino Reichardt <[email protected]>2024-01-17 18:06:14 +0100
committerBrian Behlendorf <[email protected]>2024-01-19 12:28:02 -0800
commitc1161e28513410a3f566a0e10b48e54b11b19e59 (patch)
treefdb55ad081794f29f3484a9f3e096f1bc02ea43a
parentef527958c6a1fc07177636465194625ef8e64083 (diff)
fix: variable type with zfs-tests/cmd/clonefile.c
Compiling on arm64 freebsd-13.2 and arm64 almalinux-8 brings currently this error: ``` CC tests/zfs-tests/cmd/clonefile.o tests/zfs-tests/cmd/clonefile.c:166:43: error: result of comparison of \ constant -1 with expression of type 'char' is always true \ [-Werror,-Wtautological-constant-out-of-range-compare] while ((c = getopt(argc, argv, "crfdq")) != -1) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~ 1 error generated. gmake[2]: *** [Makefile:8675: tests/zfs-tests/cmd/clonefile.o] Error 1 ``` Fix: use correct variable type `int`. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Rob Norris <[email protected]> Signed-off-by: Tino Reichardt <[email protected]> Closes #15783
-rw-r--r--tests/zfs-tests/cmd/clonefile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/zfs-tests/cmd/clonefile.c b/tests/zfs-tests/cmd/clonefile.c
index d002cd9b5..bc30bb779 100644
--- a/tests/zfs-tests/cmd/clonefile.c
+++ b/tests/zfs-tests/cmd/clonefile.c
@@ -162,7 +162,7 @@ main(int argc, char **argv)
{
cf_mode_t mode = CF_MODE_NONE;
- char c;
+ int c;
while ((c = getopt(argc, argv, "crfdq")) != -1) {
switch (c) {
case 'c':