11159 libdiskmgt: NULL pointer errors

Review Request #1944 — Created June 1, 2019 and submitted

tsoome
illumos-gate
11159
e9d91bf...
general
In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                 from ../common/events.c:29:
../common/events.c: In function 'dm_init_event_queue':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'thr_create' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
../common/events.c:154:32: note: in expansion of macro 'NULL'
       *errp = thr_create(NULL, NULL,
                                ^~~~
In file included from ../common/events.c:33:0:
/code/illumos-gate/proto/root_i386/usr/include/thread.h:54:12: note: expected 'size_t {aka unsigned int}' but argument is of type 'void *'
 extern int thr_create(void *, size_t, void *(*)(void *), void *, long,
            ^~~~~~~~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                 from ../common/events.c:29:
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'thr_create' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
../common/events.c:174:28: note: in expansion of macro 'NULL'
   *errp = thr_create(NULL, NULL,
                            ^~~~
In file included from ../common/events.c:33:0:
/code/illumos-gate/proto/root_i386/usr/include/thread.h:54:12: note: expected 'size_t {aka unsigned int}' but argument is of type 'void *'
 extern int thr_create(void *, size_t, void *(*)(void *), void *, long,
            ^~~~~~~~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                 from ../common/events.c:29:
../common/events.c: In function 'walk_devtree':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'thr_create' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
../common/events.c:448:27: note: in expansion of macro 'NULL'
      if (thr_create(NULL, NULL, (void *(*)(void *))walker, NULL,
                           ^~~~
In file included from ../common/events.c:33:0:
/code/illumos-gate/proto/root_i386/usr/include/thread.h:54:12: note: expected 'size_t {aka unsigned int}' but argument is of type 'void *'
 extern int thr_create(void *, size_t, void *(*)(void *), void *, long,
            ^~~~~~~~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdlib_iso.h:50:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/stdlib.h:37,
                 from ../common/inuse_mnt.c:32:
../common/inuse_mnt.c: In function 'inuse_mnt':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'thr_create' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
../common/inuse_mnt.c:94:28: note: in expansion of macro 'NULL'
   *errp = thr_create(NULL, NULL, (void *(*)(void *))watch_mnttab,
                            ^~~~
In file included from ../common/inuse_mnt.c:36:0:
/code/illumos-gate/proto/root_i386/usr/include/thread.h:54:12: note: expected 'size_t {aka unsigned int}' but argument is of type 'void *'
 extern int thr_create(void *, size_t, void *(*)(void *), void *, long,
            ^~~~~~~~~~

../common/media.c: In function 'get_rmm_name':
../common/media.c:552:26: error: comparison between pointer and integer [-Werror]
     if (vtoc.v_volume[0] != NULL) {
                          ^~
../common/entry.c: In function 'dm_free_descriptor':
../common/entry.c:72:11: error: comparison between pointer and integer [-Werror]
  if (desc == NULL) {
           ^~
In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                 from /code/illumos-gate/proto/root_i386/usr/include/fcntl.h:39,
                 from ../common/entry.c:26:
../common/entry.c: In function 'dm_get_descriptor_by_name':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
../common/entry.c:256:25: note: in expansion of macro 'NULL'
  dm_descriptor_t desc = NULL;
                         ^~~~
../common/entry.c: In function 'dm_get_slices':
../common/entry.c:519:12: error: comparison between pointer and integer [-Werror]
  if (alias != NULL) {
            ^~
../common/entry.c: In function 'dm_get_slice_stats':
../common/entry.c:554:11: error: comparison between pointer and integer [-Werror]
  if (devp != NULL) {
           ^~
In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                 from /code/illumos-gate/proto/root_i386/usr/include/fcntl.h:39,
                 from ../common/entry.c:26:
../common/entry.c: In function 'dm_isoverlapping':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
../common/entry.c:569:26: note: in expansion of macro 'NULL'
  dm_descriptor_t slice = NULL;
                          ^~~~
../common/entry.c:583:12: error: comparison between pointer and integer [-Werror]
  if (slice == NULL)
            ^~
../common/entry.c:591:30: error: comparison between pointer and integer [-Werror]
  if (media == NULL || *media == NULL || *errp != 0)
                              ^~
../common/entry.c:595:32: error: comparison between pointer and integer [-Werror]
  if (slices == NULL || *slices == NULL || *errp != 0)
                                ^~
../common/drive.c: In function 'get_disk_kstats':
../common/drive.c:976:10: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
   *dname = NULL;
          ^
cc1: all warnings being treated as errors


jlevon
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...