]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
plugins: Force types for isalnum and isblank
authorDaniel Wagner <dwagner@suse.de>
Thu, 9 Dec 2021 12:48:30 +0000 (13:48 +0100)
committerDaniel Wagner <dwagner@suse.de>
Thu, 9 Dec 2021 12:55:02 +0000 (13:55 +0100)
commita2479b1a9f01ec11a43236ee4eea93ac0c16f724
tree723661e473baee5e5c9dd4a5de115109cd447b17
parent9359be63fa6802c7ab5eed4e395002ac67b4e876
plugins: Force types for isalnum and isblank

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>
plugins/memblaze/memblaze-nvme.c
plugins/micron/micron-nvme.c