Skip to content

Commit

Permalink
fix: variable type with zfs-tests/cmd/clonefile.c
Browse files Browse the repository at this point in the history
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 <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #15783
  • Loading branch information
mcmilk authored and mmatuska committed Jan 18, 2024
1 parent 9a736d1 commit 64d236f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/zfs-tests/cmd/clonefile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 64d236f

Please sign in to comment.