11406 picl: NULL pointer errors

Review Request #2128 - Created July 11, 2019 and submitted

Information
Toomas Soome
illumos-gate
11406
23b3b10...
Reviewers
general
piclmemcfg_comm.c: In function 'undo_phymem_tree':
piclmemcfg_comm.c:218:20: error: comparison between pointer and integer [-Werror]
   if (mmghdl->mmgh == NULL)
                    ^~
piclmemcfg_comm.c:228:30: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
   mmghdl->mch = mmghdl->mmgh = NULL;
                              ^
piclmemcfg_comm.c: In function 'piclmemcfg_evhandler':
piclmemcfg_comm.c:900:7: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
  memh = NULL;
       ^
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 piclmemcfg_comm.c:49:
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 4 of 'nvlist_unpack' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
piclmemcfg_comm.c:901:47: note: in expansion of macro 'NULL'
  if (nvlist_unpack((char *)earg, size, &nvlp, NULL))
                                               ^~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/libnvpair.h:29:0,
                 from piclmemcfg_comm.c:65:
/code/illumos-gate/proto/root_i386/usr/include/sys/nvpair.h:159:5: note: expected 'int' but argument is of type 'void *'
 int nvlist_unpack(char *, size_t, nvlist_t **, int);
     ^~~~~~~~~~~~~

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 picldevtree.c:30:
picldevtree.c: In function 'mc_completion_handler':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 4 of 'nvlist_unpack' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
picldevtree.c:284:45: note: in expansion of macro 'NULL'
      nvlist_unpack(earg, size, &unpack_nvl, NULL) == 0) {
                                             ^~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/libnvpair.h:29:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/libdevinfo.h:33,
                 from picldevtree.c:40:
/code/illumos-gate/proto/root_i386/usr/include/sys/nvpair.h:159:5: note: expected 'int' but argument is of type 'void *'
 int nvlist_unpack(char *, size_t, nvlist_t **, int);
     ^~~~~~~~~~~~~
picldevtree.c:285:7: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
   mch = NULL;
       ^
picldevtree.c:288:11: error: comparison between pointer and integer [-Werror]
   if (mch != NULL) {
           ^~
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 picldevtree.c:30:
picldevtree.c: In function 'post_mc_event':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 3 of 'nvlist_alloc' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
picldevtree.c:317:46: note: in expansion of macro 'NULL'
  if (nvlist_alloc(&nvl, NV_UNIQUE_NAME_TYPE, NULL)) {
                                              ^~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/libnvpair.h:29:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/libdevinfo.h:33,
                 from picldevtree.c:40:
/code/illumos-gate/proto/root_i386/usr/include/sys/nvpair.h:155:5: note: expected 'int' but argument is of type 'void *'
 int nvlist_alloc(nvlist_t **, uint_t, int);
     ^~~~~~~~~~~~
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 picldevtree.c:30:
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 5 of 'nvlist_pack' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
picldevtree.c:324:63: note: in expansion of macro 'NULL'
      nvlist_pack(nvl, &pack_buf, &nvl_size, NV_ENCODE_NATIVE, NULL)) {
                                                               ^~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/libnvpair.h:29:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/libdevinfo.h:33,
                 from picldevtree.c:40:
/code/illumos-gate/proto/root_i386/usr/include/sys/nvpair.h:158:5: note: expected 'int' but argument is of type 'void *'
 int nvlist_pack(nvlist_t *, char **, size_t *, int, int);
     ^~~~~~~~~~~
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 picldevtree.c:30:
picldevtree.c: In function 'picldevtree_evhandler':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 4 of 'nvlist_unpack' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
picldevtree.c:3630:47: note: in expansion of macro 'NULL'
  if (nvlist_unpack((char *)earg, size, &nvlp, NULL) ||
                                               ^~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/libnvpair.h:29:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/libdevinfo.h:33,
                 from picldevtree.c:40:
/code/illumos-gate/proto/root_i386/usr/include/sys/nvpair.h:159:5: note: expected 'int' but argument is of type 'void *'
 int nvlist_unpack(char *, size_t, nvlist_t **, int);
     ^~~~~~~~~~~~~

In file included from /code/illumos-gate/proto/root_i386/usr/include/unistd.h:40:0,
                 from picl_slm.c:29:
picl_slm.c: In function 'piclslm_deliver_event':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 3 of 'nvlist_alloc' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
picl_slm.c:347:46: note: in expansion of macro 'NULL'
  if (nvlist_alloc(&nvl, NV_UNIQUE_NAME_TYPE, NULL)) {
                                              ^~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/sys/errorq.h:32:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/ddifm_impl.h:30,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/ndifm.h:35,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/ddi_impldefs.h:40,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/sunddi.h:43,
                 from picl_slm.c:36:
/code/illumos-gate/proto/root_i386/usr/include/sys/nvpair.h:155:5: note: expected 'int' but argument is of type 'void *'
 int nvlist_alloc(nvlist_t **, uint_t, int);
     ^~~~~~~~~~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/unistd.h:40:0,
                 from picl_slm.c:29:
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 5 of 'nvlist_pack' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
picl_slm.c:374:63: note: in expansion of macro 'NULL'
      nvlist_pack(nvl, &pack_buf, &nvl_size, NV_ENCODE_NATIVE, NULL)) {
                                                               ^~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/sys/errorq.h:32:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/ddifm_impl.h:30,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/ndifm.h:35,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/ddi_impldefs.h:40,
                 from /code/illumos-gate/proto/root_i386/usr/include/sys/sunddi.h:43,
                 from picl_slm.c:36:
/code/illumos-gate/proto/root_i386/usr/include/sys/nvpair.h:158:5: note: expected 'int' but argument is of type 'void *'
 int nvlist_pack(nvlist_t *, char **, size_t *, int, int);
     ^~~~~~~~~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/unistd.h:40:0,
                 from picl_slm.c:29:
picl_slm.c: In function 'slm_init':
/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)
              ^
picl_slm.c:405:23: note: in expansion of macro 'NULL'
  if (thr_create(NULL, NULL, piclslm_deliver_thr,
                       ^~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/libsysevent.h:29:0,
                 from picl_slm.c:37:
/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 piclevent.c:33:
piclevent.c: In function 'parse_piclevent':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 5 of 'nvlist_pack' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
piclevent.c:114:66: note: in expansion of macro 'NULL'
  if (nvlist_pack(nvlp, &packed_nvl, &nvl_size, NV_ENCODE_NATIVE, NULL))
                                                                  ^~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/libnvpair.h:29:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/libdevinfo.h:33,
                 from piclevent.c:43:
/code/illumos-gate/proto/root_i386/usr/include/sys/nvpair.h:158:5: note: expected 'int' but argument is of type 'void *'
 int nvlist_pack(nvlist_t *, char **, size_t *, int, int);
     ^~~~~~~~~~~
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 piclevent.c:33:
piclevent.c: In function 'event_handler':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 4 of 'nvlist_unpack' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
piclevent.c:161:40: note: in expansion of macro 'NULL'
  if (nvlist_unpack(argp, asize, &nvlp, NULL))
                                        ^~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/libnvpair.h:29:0,
                 from /code/illumos-gate/proto/root_i386/usr/include/libdevinfo.h:33,
                 from piclevent.c:43:
/code/illumos-gate/proto/root_i386/usr/include/sys/nvpair.h:159:5: note: expected 'int' but argument is of type 'void *'
 int nvlist_unpack(char *, size_t, nvlist_t **, int);
     ^~~~~~~~~~~~~

../picld_pluginutil.c: In function 'undo_commands':
../picld_pluginutil.c:141:29: error: comparison between pointer and integer [-Werror]
    if (com[i].nodecmd_nodeh == NULL)
                             ^~
../picld_pluginutil.c:148:32: error: comparison between pointer and integer [-Werror]
    if (com[i].refnodecmd_nodeh == NULL)
                                ^~
../picld_pluginutil.c:154:29: error: comparison between pointer and integer [-Werror]
    if (com[i].propcmd_proph == NULL)
                             ^~
../picld_pluginutil.c:160:32: error: comparison between pointer and integer [-Werror]
    if (com[i].refpropcmd_proph == NULL)
                                ^~
../picld_pluginutil.c:166:30: error: comparison between pointer and integer [-Werror]
    if ((com[i].tablecmd_tblh == NULL) ||
                              ^~
../picld_pluginutil.c: In function 'parse_node':
../picld_pluginutil.c:338:25: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
  command->nodecmd_nodeh = NULL;
                         ^
../picld_pluginutil.c: In function 'parse_prop':
../picld_pluginutil.c:640:26: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
   command->propcmd_proph = NULL;
                          ^
../picld_pluginutil.c:686:25: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
  command->propcmd_proph = NULL;
                         ^
../picld_pluginutil.c: In function 'parse_refnode':
../picld_pluginutil.c:806:28: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
  command->refnodecmd_nodeh = NULL;
                            ^
../picld_pluginutil.c: In function 'parse_refprop':
../picld_pluginutil.c:882:28: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
  command->refpropcmd_proph = NULL;
                            ^
../picld_pluginutil.c: In function 'parse_table':
../picld_pluginutil.c:975:25: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
  command->tablecmd_tblh = NULL;
                         ^

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 picld.c:31:
picld.c: In function 'main':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 1 of 'xptree_initialize' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
picld.c:1177:24: note: in expansion of macro 'NULL'
  if (xptree_initialize(NULL) != PICL_SUCCESS) {
                        ^~~~
In file included from picld.c:61:0:
../../../lib/libpicltree/ptree_impl.h:222:12: note: expected 'int' but argument is of type 'void *'
 extern int xptree_initialize(int);
            ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

  
Andy Fiddaman
Toomas Soome
Review request changed

Status: Closed (submitted)

Loading...