The two users of isalnum and isblank hand in unsigned char and not
int as expected by the API. This triggers thye type checker in the
debug build, e.g.
../subprojects/libnvme/ccan/ccan/build_assert/build_assert.h:38:22: error: size of unnamed array is negative
38 | (sizeof(char [1 - 2*!(cond)]) - 1)
| ^
../ccan/ccan/str/str.h:189:16: note: in expansion of macro ‘BUILD_ASSERT_OR_ZERO’
189 | ((i) + BUILD_ASSERT_OR_ZERO(!__builtin_types_compatible_p(typeof(i), \
| ^~~~~~~~~~~~~~~~~~~~
../ccan/ccan/str/str.h:196:32: note: in expansion of macro ‘str_check_arg_’
196 | #define isalnum(i) str_isalnum(str_check_arg_(i))
| ^~~~~~~~~~~~~~
../plugins/memblaze/memblaze-nvme.c:410:13: note: in expansion of macro ‘isalnum’
410 | if (isalnum(*c) == 0) {
| ^~~~~~~
Signed-off-by: Daniel Wagner <dwagner@suse.de>
exit(EINVAL);
}
- if (isalnum(*c) == 0) {
+ if (isalnum((int)*c) == 0) {
printf("%s is not a valid number\n", c);
return 1;
}
// trim spaces out of serial number string */
int i, j = 0;
for (i = 0; i < sizeof(ctrl.sn); i++) {
- if (isblank(ctrl.sn[i]))
+ if (isblank((int)ctrl.sn[i]))
continue;
sn[j++] = ctrl.sn[i];
}