Project

General

Profile

Bug #11344

fm: NULL pointer errors

Added by Toomas Soome 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with NULL pointer:

    sensor_transport.c: In function 'parse_spoof_param':
    sensor_transport.c:391:55: error: comparison between pointer and integer [-Werror]
      if (nvlist_alloc(&stp->st_spoofs, NV_UNIQUE_NAME, 0) != NULL) {
                                                           ^~

    ip.c: In function 'ip_timeout':
    ip.c:870:21: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        cinfo->ipc_timer = NULL;
                         ^
    ip.c:874:24: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        ipx->ipx_spnd_timer = NULL;
                            ^
    ip.c:890:22: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
         cinfo->ipc_timer = 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 fdd_msg.c:45:
    /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)
                  ^
    fdd_msg.c:75:3: note: in expansion of macro 'NULL'
      {NULL, 0, 0, NULL}
       ^~~~
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: note: (near initialization for 'fma_cap_list[4].vendor[0]')
     #define NULL ((void *)0)
                  ^
    fdd_msg.c:75:3: note: in expansion of macro 'NULL'
      {NULL, 0, 0, NULL}
       ^~~~
    /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)
                  ^
    fdd_msg.c:75:15: note: in expansion of macro 'NULL'
      {NULL, 0, 0, NULL}
                   ^~~~
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: note: (near initialization for 'fma_cap_list[4].vendor[3]')
     #define NULL ((void *)0)
                  ^
    fdd_msg.c:75:15: note: in expansion of macro 'NULL'
      {NULL, 0, 0, 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/usr/src/uts/common/sys/time.h:462,
                     from /code/illumos-gate/usr/src/uts/common/sys/select.h:53,
                     from /code/illumos-gate/usr/src/uts/common/sys/types.h:640,
                     from /code/illumos-gate/proto/root_i386/usr/include/strings.h:32,
                     from fx_fire.c:26:
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fire.c:69:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_fire_pec_ue_tbl[11].fire_bit')
     #define NULL ((void *)0)
                  ^
    fx_fire.c:69:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fire.c:69:14: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
                  ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_fire_pec_ue_tbl[11].pci_err_sts')
     #define NULL ((void *)0)
                  ^
    fx_fire.c:69:14: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
                  ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fire.c:80:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_fire_pec_ce_tbl[5].fire_bit')
     #define NULL ((void *)0)
                  ^
    fx_fire.c:80:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fire.c:80:14: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
                  ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_fire_pec_ce_tbl[5].pci_err_sts')
     #define NULL ((void *)0)
                  ^
    fx_fire.c:80:14: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
                  ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fire.c:100:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_fire_pec_oe_tbl[6].fire_bit')
     #define NULL ((void *)0)
                  ^
    fx_fire.c:100:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fire.c:100:14: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
                  ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_fire_pec_oe_tbl[6].pci_err_sts')
     #define NULL ((void *)0)
                  ^
    fx_fire.c:100:14: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
                  ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fire.c:118:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_fire_dmc_tbl[10].fire_bit')
     #define NULL ((void *)0)
                  ^
    fx_fire.c:118:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fire.c:118:14: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
                  ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_fire_dmc_tbl[10].pci_err_sts')
     #define NULL ((void *)0)
                  ^
    fx_fire.c:118:14: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
                  ^~~~

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stddef_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stddef.h:35,
                     from fx_fabric.c:26:
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:53:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_pci_erpt_tbl[6].reg_bit')
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:53:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:66:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL, NULL,
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_pci_bdg_erpt_tbl[5].reg_bit')
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:66:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL, NULL,
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:73:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_pci_bdg_ctl_erpt_tbl[1].reg_bit')
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:73:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:84:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_pcie_ce_erpt_tbl[6].reg_bit')
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:84:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:107:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_pcie_ue_erpt_tbl[11].reg_bit')
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:107:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:127:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_pcie_sue_erpt_tbl[12].reg_bit')
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:127:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:135:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_pcix_erpt_tbl[3].reg_bit')
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:135:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:145:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_pcix_bdg_sec_erpt_tbl[4].reg_bit')
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:145:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:156:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_pcie_nadv_erpt_tbl[3].reg_bit')
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:156:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:166:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_pcie_rc_erpt_tbl[5].reg_bit')
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:166:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:178:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
            ^~~~
    /code/illumos-gate/usr/src/uts/common/sys/null.h:28:14: note: (near initialization for 'fab_pcie_fake_rc_erpt_tbl[3].reg_bit')
     #define NULL ((void *)0)
                  ^
    fx_fabric.c:178:8: note: in expansion of macro 'NULL'
      NULL, NULL, NULL,
            ^~~~

    eft_mdb.c: In function 'lut_walk_init':
    eft_mdb.c:133:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr == NULL) {
                         ^~
    eft_mdb.c: In function 'eft_count':
    eft_mdb.c:272:12: error: comparison between pointer and integer [-Werror]
       if (addr == NULL)
                ^~
    eft_mdb.c: In function 'eft_node':
    eft_mdb.c:376:11: error: comparison between pointer and integer [-Werror]
      if (addr == NULL)
               ^~

    ../common/faulty.c: In function 'print_line':
    ../common/faulty.c:912:20: error: comparison between pointer and integer [-Werror]
       while ((c = *ep) != NULL && (wp == NULL || i < 80)) {
                        ^~
    ../common/faulty.c:920:24: error: comparison between pointer and integer [-Werror]
         } while ((c = *ep) != NULL && c == ' ');
                            ^~

    ../common/fmd_mdb.c: In function 'trwalk_init':
    ../common/fmd_mdb.c:72:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr != NULL) {
                         ^~
    ../common/fmd_mdb.c:82:51: error: comparison between pointer and integer [-Werror]
      for (addr = (uintptr_t)F.d_thr_list.l_next; addr != NULL;
                                                       ^~
    ../common/fmd_mdb.c: In function 'hash_walk_step':
    ../common/fmd_mdb.c:338:24: error: comparison between pointer and integer [-Werror]
      while (wsp->walk_addr == NULL) {
                            ^~
    ../common/fmd_mdb.c: In function 'ustat_walk_step':
    ../common/fmd_mdb.c:387:24: error: comparison between pointer and integer [-Werror]
      while (wsp->walk_addr == NULL) {
                            ^~
    ../common/fmd_mdb.c: In function 'thread_walk_step':
    ../common/fmd_mdb.c:683:11: error: comparison between pointer and integer [-Werror]
      if (addr == NULL)
               ^~
    ../common/fmd_mdb.c: In function 'mod_walk_step':
    ../common/fmd_mdb.c:742:11: error: comparison between pointer and integer [-Werror]
      if (addr == NULL)
               ^~
    ../common/fmd_mdb.c: In function 'case_walk_init':
    ../common/fmd_mdb.c:792:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr != NULL) {
                         ^~
    ../common/fmd_mdb.c: In function 'case_walk_step':
    ../common/fmd_mdb.c:822:11: error: comparison between pointer and integer [-Werror]
      if (addr == NULL)
               ^~
    ../common/fmd_mdb.c: In function 'asru_walk_init':
    ../common/fmd_mdb.c:1012:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr == NULL && mdb_readvar(&F, "fmd") != sizeof (F)) {
                         ^~
    ../common/fmd_mdb.c:1017:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr == NULL)
                         ^~
    ../common/fmd_mdb.c: In function 'al_walk_init':
    ../common/fmd_mdb.c:1066:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr == NULL && mdb_readvar(&F, "fmd") != sizeof (F)) {
                         ^~
    ../common/fmd_mdb.c:1071:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr == NULL)
                         ^~
    ../common/fmd_mdb.c: In function 'tmq_walk_init':
    ../common/fmd_mdb.c:1367:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr == NULL && mdb_readvar(&F, "fmd") != sizeof (F)) {
                         ^~
    ../common/fmd_mdb.c:1372:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr == NULL)
                         ^~
    ../common/fmd_mdb.c: In function 'tmq_walk_step':
    ../common/fmd_mdb.c:1390:11: error: comparison between pointer and integer [-Werror]
      if (addr == NULL)
               ^~
    ../common/fmd_mdb.c: In function 'xprt_walk_init':
    ../common/fmd_mdb.c:1444:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr == NULL) {
                         ^~
    ../common/fmd_mdb.c: In function 'xprt_walk_step':
    ../common/fmd_mdb.c:1464:11: error: comparison between pointer and integer [-Werror]
      if (addr == NULL)
               ^~
    ../common/fmd_mdb.c: In function 'tsnap_walk_step':
    ../common/fmd_mdb.c:1590:11: error: comparison between pointer and integer [-Werror]
      if (addr == NULL)
               ^~
    ../common/fmd_mdb.c: In function 'mq_walk_init':
    ../common/fmd_mdb.c:1608:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr == NULL) {
                         ^~
    ../common/fmd_mdb.c: In function 'mq_walk_step':
    ../common/fmd_mdb.c:1634:11: error: comparison between pointer and integer [-Werror]
      if (addr == NULL)
               ^~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 3 months ago

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

git commit 940f2f5868892c7a40e071319100921b5b859283

commit  940f2f5868892c7a40e071319100921b5b859283
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-12T05:58:51.000Z

    11344 fm: NULL pointer errors
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF