Project

General

Profile

Actions

Bug #11133

closed

libproc: NULL pointer errors

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

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

Description

NULL pointer errors:

    Pisadep.c: In function 'Pstack_iter32':
    Pisadep.c:356:12: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        uc_addr = NULL;
                ^
    Pisadep.c:358:15: error: comparison between pointer and integer [-Werror]
       if (uc_addr != NULL &&
                   ^~

    ../common/Pstack.c: In function 'load_uclist':
    ../common/Pstack.c:179:11: error: comparison between pointer and integer [-Werror]
      if (addr == NULL)
               ^~
    ../common/Pstack.c:217:12: error: comparison between pointer and integer [-Werror]
       if (addr == 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 ../common/Psymtab_machelf32.c:32:
    ../common/Psymtab_machelf32.c: In function 'fake_elf32':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/Psymtab_machelf32.c:261:19: note: in expansion of macro 'NULL'
      uintptr_t hptr = NULL;
                       ^~~~
    ../common/Psymtab_machelf32.c:631:13: error: comparison between pointer and integer [-Werror]
       if ((hptr == NULL) || (hnbuckets == 0) || (hnchains == 0)) {
                 ^~

    Pisadep.c: In function 'Pstack_iter':
    Pisadep.c:289:12: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        uc_addr = NULL;
                ^
    Pisadep.c:291:15: error: comparison between pointer and integer [-Werror]
       if (uc_addr != NULL &&
                   ^~

    ../common/Pexecname.c: In function 'Pfindexec':
    ../common/Pexecname.c:183:24: error: comparison between pointer and integer [-Werror]
      if (P->psinfo.pr_argv != NULL &&
                            ^~

    ../common/Pcore.c: In function 'core_find_data':
    ../common/Pcore.c:1937:20: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      rlp->rl_data_base = NULL;
                        ^
    ../common/Pcore.c:1961:24: error: comparison between pointer and integer [-Werror]
      if (rlp->rl_data_base == NULL ||
                            ^~

    ../common/Psymtab.c: In function 'Paddr_to_text_map':
    ../common/Psymtab.c:627:36: error: comparison between pointer and integer [-Werror]
           (fptr->file_lo->rl_data_base == NULL ||
                                        ^~
    ../common/Psymtab.c: In function 'Penv_iter':
    ../common/Psymtab.c:3131:31: error: comparison between pointer and integer [-Werror]
       if ((envoff = envp[nenv++]) == NULL)
                                   ^~
    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 c75682cd39b9b3d382ce1b01fef06a84ca7ea0a9

commit  c75682cd39b9b3d382ce1b01fef06a84ca7ea0a9
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-03T20:33:33.000Z

    11133 libproc: NULL pointer errors
    Reviewed by: John Levon <john.levon@joyent.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF