11133 libproc: NULL pointer errors

Review Request #1917 — Created June 1, 2019 and submitted

tsoome
illumos-gate
11133
00f7d7f...
general
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


  • 0
  • 0
  • 5
  • 0
  • 5
Description From Last Updated
jlevon
  1. Actually, I think all of these should be suitable casts from NULL.

  2. usr/src/lib/libproc/amd64/Pisadep.c (Diff revision 1)
     
     

    (uintptr_t)NULL ?

  3. usr/src/lib/libproc/common/Pcore.c (Diff revision 1)
     
     

    (psaddr_t)NULL?

  4. usr/src/lib/libproc/common/Pcore.c (Diff revision 1)
     
     
  5. usr/src/lib/libproc/common/Pexecname.c (Diff revision 1)
     
     

    cast again?

  6. 
      
tsoome
jlevon
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...