Project

General

Profile

Bug #11432

stat: NULL pointer errors

Added by Toomas Soome 5 days ago.

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

90%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with NULL pointer:

    mpstat.c: In function 'main':
    mpstat.c:113:17: error: comparison between pointer and integer [-Werror]
         if (*endptr != NULL)
                     ^~
    mpstat.c:146:15: error: comparison between pointer and integer [-Werror]
       if (*endptr != NULL)
                   ^~
    mpstat.c:152:16: error: comparison between pointer and integer [-Werror]
        if (*endptr != NULL || iter < 0)
                    ^~
    mpstat.c: In function 'agg_vm':
    mpstat.c:317:20: error: comparison between pointer and integer [-Werror]
      if (p->ps_nr_cpus == NULL)
                        ^~
    mpstat.c: In function 'agg_sys':
    mpstat.c:337:20: error: comparison between pointer and integer [-Werror]
      if (p->ps_nr_cpus == NULL)
                        ^~

    /code/illumos-gate/usr/src/cmd/stat/common/dsr.c: In function 'cur_special':
    /code/illumos-gate/usr/src/cmd/stat/common/dsr.c:511:12: error: comparison between pointer and integer [-Werror]
        if (*cp == NULL)
                ^~
    /code/illumos-gate/usr/src/cmd/stat/common/dsr.c:523:8: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        *cp = NULL;
            ^

    /code/illumos-gate/usr/src/cmd/stat/common/acquire_iodevs.c: In function 'iodev_match':
    /code/illumos-gate/usr/src/cmd/stat/common/acquire_iodevs.c:358:22: error: comparison between pointer and integer [-Werror]
      if (df->if_nr_names == NULL)
                          ^~
    /code/illumos-gate/usr/src/cmd/stat/common/acquire_iodevs.c: In function 'choose_iodevs':
    /code/illumos-gate/usr/src/cmd/stat/common/acquire_iodevs.c:454:23: error: comparison between pointer and integer [-Werror]
      if ((df->if_nr_names == NULL) || (nr_iodevs != nr_iodevs_orig)) {
                           ^~
    cc1: all warnings being treated as errors

Also available in: Atom PDF