Project

General

Profile

Bug #11159

libdiskmgt: NULL pointer errors

Added by Toomas Soome 5 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

NULL pointer errors:

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/std
io_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: pass
ing argument 2 of 'thr_create' makes integer from pointer without a cast [-Werro
r=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: expecte
d '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/std
io_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: pass
ing argument 2 of 'thr_create' makes integer from pointer without a cast [-Werro
r=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: expecte
d '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/std
io_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: pass
ing argument 2 of 'thr_create' makes integer from pointer without a cast [-Werro
r=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: expecte
d '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

History

#1

Updated by Electric Monk 4 months ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit bd401f0568e6905bc051763ff8342d11c17bf032

commit  bd401f0568e6905bc051763ff8342d11c17bf032
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-03T07:41:57.000Z

    11159 libdiskmgt: NULL pointer errors
    Reviewed by: John Levon <john.levon@joyent.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF