Project

General

Profile

Actions

Bug #11300

closed

cpustat: NULL pointer errors

Added by Toomas Soome over 3 years ago. Updated about 3 years ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Build errors with NULL pointer:

    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 ../common/cpustat.c:26:
    /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/cpustat.c:93:37: note: in expansion of macro 'NULL'
     static pcinfo_t fxinfo = { 0, "FX", NULL }; /* FX scheduler class info */
                                         ^~~~
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: note: (near initialization for 'fxinfo.pc_clinfo[0]')
     #define NULL ((void *)0)
                  ^
    ../common/cpustat.c:93:37: note: in expansion of macro 'NULL'
     static pcinfo_t fxinfo = { 0, "FX", NULL }; /* FX scheduler class info */
                                         ^~~~
    ../common/cpustat.c: In function 'gtick':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 5 of 'thr_create' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/cpustat.c:447:42: note: in expansion of macro 'NULL'
       if (thr_create(NULL, 0, soaker, state, NULL, &tid) != 0)
                                              ^~~~
    In file included from ../common/cpustat.c:40:0:
    /code/illumos-gate/proto/root_i386/usr/include/thread.h:54:12: note: expected 'long int' but argument is of type 'void *'
     extern int thr_create(void *, size_t, void *(*)(void *), void *, long,
                ^~~~~~~~~~
    cc1: all warnings being treated as errors

Actions #1

Updated by Electric Monk about 3 years ago

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

git commit f9d4be10f65289547fa67ea8d1a3de54596b3ba1

commit  f9d4be10f65289547fa67ea8d1a3de54596b3ba1
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-08T16:44:36.000Z

    11300 cpustat: NULL pointer errors
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF