Project

General

Profile

Bug #11319

devfsadm: 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:

    ../cfg_link.c: In function 'pci_cfg_ap_path':
    ../cfg_link.c:730:26: error: comparison between pointer and integer [-Werror]
        if ((curnode == node) != NULL)
                              ^~

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:50:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/string.h:33,
                     from ../devfsadm.c:38:
    ../devfsadm.c: In function 'main':
    /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)
                  ^
    ../devfsadm.c:380:25: note: in expansion of macro 'NULL'
        if (thr_create(NULL, NULL,
                             ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/libsysevent.h:29:0,
                     from ../devfsadm_impl.h:67,
                     from ../devfsadm.c:47:
    /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/string_iso.h:50:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/string.h:33,
                     from ../devfsadm.c:38:
    /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)
                  ^
    ../devfsadm.c:392:25: note: in expansion of macro 'NULL'
        if (thr_create(NULL, NULL,
                             ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/libsysevent.h:29:0,
                     from ../devfsadm_impl.h:67,
                     from ../devfsadm.c:47:
    /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,
                ^~~~~~~~~~
    ../devfsadm.c: In function 'parse_args':
    ../devfsadm.c:707:43: error: comparison between pointer and integer [-Werror]
        if ((mc.major == -1) || (mc.drvname[0] == NULL)) {
                                               ^~
    ../devfsadm.c: In function 'create_selector_list':
    ../devfsadm.c:6346:20: error: comparison between pointer and integer [-Werror]
      while ((*selector != NULL) && (error == FALSE)) {
                        ^~
    ../devfsadm.c: In function 'getnexttoken':
    ../devfsadm.c:7549:8: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        *cp = NULL; /* terminate token */
            ^
    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 a3ab7e857d66d206fcfc56f9a628266bd25a7bd0

commit  a3ab7e857d66d206fcfc56f9a628266bd25a7bd0
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-09T05:39:26.000Z

    11319 devfsadm: NULL pointer errors
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF