Project

General

Profile

Bug #11130

libtnfctl: NULL pointer errors

Added by Toomas Soome 5 months ago. Updated 3 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

NULL pointer errors:

    ../targmem.c: In function '_tnfctl_targmem_alloc':
    ../targmem.c:52:10: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *addr_p = NULL;
              ^

    ../elf.c: In function '_tnfctl_elf_dbgent':
    ../elf.c:90:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *entaddr_p = NULL;
                 ^

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:50:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/string.h:33,
                     from ../traverse.c:34:
    ../traverse.c: In function '_tnfctl_traverse_object':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 3 of 'elf_strptr' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../traverse.c:93:43: note: in expansion of macro 'NULL'
      strs = elf_strptr(elf, ehdr->e_shstrndx, NULL);
                                               ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/gelf.h:34:0,
                     from ../tnfctl.h:32,
                     from ../tnfctl_int.h:40,
                     from ../traverse.c:41:
    /code/illumos-gate/proto/root_i386/usr/include/libelf.h:202:8: note: expected 'size_t {aka unsigned int}' but argument is of type 'void *'
     char  *elf_strptr(Elf *, size_t, size_t);
            ^~~~~~~~~~

    ../comb.c: In function '_tnfctl_comb_build':
    ../comb.c:131:10: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *comb_p = NULL;
              ^
    ../comb.c: In function 'decode':
    ../comb.c:292:24: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       new_p->func_addrs[0] = NULL;
                            ^
    ../comb.c: In function 'find':
    ../comb.c:485:11: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      key.comb = NULL;
               ^
    ../comb.c: In function 'build':
    ../comb.c:575:10: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *comb_p = NULL;
              ^
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 3 months ago

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

git commit fba8753da238a5277a57b5679d6ef024e84d5372

commit  fba8753da238a5277a57b5679d6ef024e84d5372
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-03T05:30:24.000Z

    11130 libtnfctl: NULL pointer errors
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF