Project

General

Profile

Bug #11318

svc: NULL pointer errors

Added by Toomas Soome over 1 year ago. Updated over 1 year ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with NULL pointer:

    restarter.c: In function 'refresh_instance':
    restarter.c:1741:19: error: incompatible types when assigning to type 'restarter_str_t {aka enum <anonymous>}' from type 'void *'
       info->sf_reason = 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 /code/illumos-gate/proto/root_i386/usr/include/libsysevent.h:28,
                     from protocol.c:48:
    protocol.c: In function 'graph_protocol_init':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 3 of 'startd_list_create' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    protocol.c:92:52: note: in expansion of macro 'NULL'
          graph_protocol_event_queue_pool, graph_queue, NULL);
                                                        ^~~~
    In file included from protocol.h:28:0,
                     from protocol.c:60:
    ./startd.h:749:12: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *'
     uu_list_t *startd_list_create(uu_list_pool_t *, void *, uint32_t);
                ^~~~~~~~~~~~~~~~~~
    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 /code/illumos-gate/proto/root_i386/usr/include/libsysevent.h:28,
                     from protocol.c:48:
    protocol.c: In function 'restarter_protocol_init':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 3 of 'startd_list_create' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    protocol.c:207:60: note: in expansion of macro 'NULL'
          restarter_protocol_event_queue_pool, restarter_queue, NULL);
                                                                ^~~~
    In file included from protocol.h:28:0,
                     from protocol.c:60:
    ./startd.h:749:12: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *'
     uu_list_t *startd_list_create(uu_list_pool_t *, void *, uint32_t);
                ^~~~~~~~~~~~~~~~~~

    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/sys/contract.h:29,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/contract/process.h:31,
                     from method.c:48:
    method.c: In function 'method_run':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 3 of 'waitpid' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    method.c:951:34: note: in expansion of macro 'NULL'
        r = waitpid(pid, &ret_status, NULL);
                                      ^~~~
    In file included from method.c:54:0:
    /code/illumos-gate/proto/root_i386/usr/include/sys/wait.h:99:14: note: expected 'int' but argument is of type 'void *'
     extern pid_t waitpid(pid_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 startd.c:198:
    startd.c: In function 'read_startd_config':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 8 of 'scf_handle_decode_fmri' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    startd.c:600:24: note: in expansion of macro 'NULL'
          NULL, NULL, prop, NULL) != -1 &&
                            ^~~~
    In file included from startd.c:211:0:
    /code/illumos-gate/proto/root_i386/usr/include/libscf.h:690:5: note: expected 'int' but argument is of type 'void *'
     int scf_handle_decode_fmri(scf_handle_t *, const char *, scf_scope_t *,
         ^~~~~~~~~~~~~~~~~~~~~~

    graph.c: In function 'do_uadmin':
    graph.c:3564:7: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      mdep = 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 /code/illumos-gate/proto/root_i386/usr/include/libscf.h:31,
                     from svcs.h:32,
                     from svcs.c:51:
    svcs.c: In function 'get_restarter_time_prop':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 6 of 'inst_get_single_val' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    svcs.c:557:11: note: in expansion of macro 'NULL'
          tvp, NULL, ok_if_empty ? EMPTY_OK : 0, 0, 1);
               ^~~~
    svcs.c:501:1: note: expected 'size_t {aka unsigned int}' but argument is of type 'void *'
     inst_get_single_val(scf_instance_t *inst, const char *pgname,
     ^~~~~~~~~~~~~~~~~~~
    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 /code/illumos-gate/proto/root_i386/usr/include/libscf.h:31,
                     from svcs.h:32,
                     from svcs.c:51:
    svcs.c: In function 'sprint_stime':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 5 of 'pg_get_single_val' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    svcs.c:1654:27: note: in expansion of macro 'NULL'
           SCF_TYPE_TIME, &tv, NULL, 0);
                               ^~~~
    svcs.c:360:1: note: expected 'size_t {aka unsigned int}' but argument is of type 'void *'
     pg_get_single_val(scf_propertygroup_t *pg, const char *propname, scf_type_t ty,
     ^~~~~~~~~~~~~~~~~
    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 /code/illumos-gate/proto/root_i386/usr/include/libscf.h:31,
                     from svcs.h:32,
                     from svcs.c:51:
    svcs.c: In function 'sortkey_stime':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 5 of 'pg_get_single_val' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    svcs.c:1706:27: note: in expansion of macro 'NULL'
           SCF_TYPE_TIME, &tv, NULL, 0);
                               ^~~~
    svcs.c:360:1: note: expected 'size_t {aka unsigned int}' but argument is of type 'void *'
     pg_get_single_val(scf_propertygroup_t *pg, const char *propname, scf_type_t ty,
     ^~~~~~~~~~~~~~~~~
    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 /code/illumos-gate/proto/root_i386/usr/include/libscf.h:31,
                     from svcs.h:32,
                     from svcs.c:51:
    svcs.c: In function 'print_detailed':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 5 of 'pg_get_single_val' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    svcs.c:2520:27: note: in expansion of macro 'NULL'
           SCF_TYPE_TIME, &tv, NULL, 0) == 0) {
                               ^~~~
    svcs.c:360:1: note: expected 'size_t {aka unsigned int}' but argument is of type 'void *'
     pg_get_single_val(scf_propertygroup_t *pg, const char *propname, scf_type_t ty,
     ^~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

#1

Updated by Electric Monk over 1 year ago

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

git commit 5f8fc372c68f2e0f1544c42850078877e5e2da3a

commit  5f8fc372c68f2e0f1544c42850078877e5e2da3a
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-06T14:32:28.000Z

    11318 svc: NULL pointer errors
    Reviewed by: C Fraire <cfraire@me.com>
    Approved by: Garrett D'Amore <garrett@damore.org>

Also available in: Atom PDF