11435 svr4pkg: NULL pointer errors

Review Request #2153 - Created July 11, 2019 and updated

Information
Toomas Soome
illumos-gate
11435
2f642c3...
Reviewers
general
tic_scan.c
tic_scan.c: In function 'get_token':
tic_scan.c:234:11: error: comparison between pointer and integer [-Werror]
    if (ch != NULL && ch != ',')
           ^~
tic_scan.c:236:11: error: comparison between pointer and integer [-Werror]
    if (ch == NULL)
           ^~
tic_scan.c: In function 'trans_string':
tic_scan.c:496:10: error: return makes integer from pointer without a cast [-Werror=int-conversion]
   return (NULL);
          ^

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 /code/illumos-gate/proto/root_i386/usr/include/door.h:30,
                 from pkgserv.c:70:
pkgserv.c: In function 'pkg_door_srv':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 4 of 'door_return' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
pkgserv.c:583:44: note: in expansion of macro 'NULL'
  (void) door_return((void *)&one, 4, NULL, NULL);
                                            ^~~~
In file included from pkgserv.c:70:0:
/code/illumos-gate/proto/root_i386/usr/include/door.h:51:5: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
 int door_return(char *, size_t, door_desc_t *, uint_t);
     ^~~~~~~~~~~
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 /code/illumos-gate/proto/root_i386/usr/include/door.h:30,
                 from pkgserv.c:70:
pkgserv.c: In function 'pkgfilter':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'thr_create' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
pkgserv.c:1266:23: note: in expansion of macro 'NULL'
  if (thr_create(NULL, NULL, thr_pkgfilter, cpf, THR_DETACHED,
                       ^~~~
In file included from pkgserv.c:89:0:
/code/illumos-gate/proto/root_i386/usr/include/thread.h:54:12: note: expected 'size_t {aka unsigned int}' but argument is of type 'void *'
 extern int thr_create(void *, size_t, void *(*)(void *), void *, long,
            ^~~~~~~~~~

check.c: In function 'rckrunlevel':
check.c:103:27: error: comparison between pointer and integer [-Werror]
   if (strcmp(pt, uxstate) == NULL) {
                           ^~
check.c: In function 'rckpriv':
check.c:223:40: error: comparison between pointer and integer [-Werror]
   if ((strcmp(dp->d_name, "preremove") == NULL) ||
                                        ^~
check.c:224:41: error: comparison between pointer and integer [-Werror]
       (strcmp(dp->d_name, "postremove") == NULL) ||
                                         ^~
check.c:225:37: error: comparison between pointer and integer [-Werror]
       (strncmp(dp->d_name, "r.", 2) == NULL)) {
                                     ^~

mkpkgmap.c: In function 'doinclude':
mkpkgmap.c:603:12: error: comparison between pointer and integer [-Werror]
  if (*temp == NULL)
            ^~

main.c: In function 'main':
main.c:430:10: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
   *value = NULL; /* terminate the parameter */
          ^

quit.c: In function 'quit':
quit.c:292:17: error: comparison between pointer and integer [-Werror]
   if (tmpdir[0] != NULL)
                 ^~
quit.c:297:17: error: comparison between pointer and integer [-Werror]
   if (tmpdir[0] != NULL) {
                 ^~

getinst.c: In function 'getinst':
getinst.c:113:37: error: comparison between pointer and integer [-Werror]
   if (strcmp(info[i].arch, pkgarch) == NULL) {
                                     ^~
getinst.c:116:41: error: comparison between pointer and integer [-Werror]
    if (strcmp(info[i].version, pkgvers) == NULL) {
                                         ^~
getinst.c:192:26: error: comparison between pointer and integer [-Werror]
  if (strcmp(inst, "new") == NULL) {
                          ^~

pkginfo.c: In function 'main':
pkginfo.c:282:38: error: comparison between pointer and integer [-Werror]
  if (pkg[0] && strcmp(pkg[0], "all") == NULL) {
                                      ^~
pkginfo.c: In function 'report':
pkginfo.c:361:41: error: comparison between pointer and integer [-Werror]
   if (info.name == NULL || *(info.name) == NULL ||
                                         ^~
pkginfo.c:362:41: error: comparison between pointer and integer [-Werror]
       info.arch == NULL || *(info.arch) == NULL ||
                                         ^~
pkginfo.c:363:47: error: comparison between pointer and integer [-Werror]
       info.version == NULL || *(info.version) == NULL ||
                                               ^~
pkginfo.c:364:41: error: comparison between pointer and integer [-Werror]
       info.catg == NULL || *(info.catg) == NULL) {
                                         ^~
pkginfo.c: In function 'fpkg':
pkginfo.c:547:36: error: comparison between pointer and integer [-Werror]
   if (strcmp(dp->pkginst, pkginst) == NULL)
                                    ^~

ckentry.c: In function 'xdir':
ckentry.c:227:32: error: comparison between pointer and integer [-Werror]
   if (strcmp(drp->d_name, ".") == NULL ||
                                ^~
ckentry.c:228:33: error: comparison between pointer and integer [-Werror]
       strcmp(drp->d_name, "..") == NULL)
                                 ^~

checkmap.c: In function 'selpkg':
checkmap.c:329:21: error: comparison between pointer and integer [-Werror]
     if (selected[i] == NULL) {
                     ^~

scriptvfy.l: In function 'scripteval':
scriptvfy.l:629:45: error: comparison between pointer and integer [-Werror]
  if ((script_path == NULL) || (*script_path == NULL) ||
                                             ^~

pkgobjmap.c: In function 'seed_pkgobjmap':
pkgobjmap.c:230:10: error: return makes integer from pointer without a cast [-Werror=int-conversion]
   return (NULL);
          ^

pkgdbmerg.c: In function 'merg':
pkgdbmerg.c:933:36: error: comparison between pointer and integer [-Werror]
        el_ent->cf_ent.ainfo.local) != NULL) {
                                    ^~
pkgdbmerg.c:942:14: error: comparison between pointer and integer [-Werror]
         "?") == NULL) {
              ^~

mntinfo.c: In function 'get_server_host':
mntinfo.c:226:52: error: comparison between pointer and integer [-Werror]
    if ((strcmp(fs_tab[n]->fstype, MNTTYPE_AUTOFS)) == NULL)
                                                    ^~
mntinfo.c: In function 'fsys':
mntinfo.c:1124:39: error: comparison between pointer and integer [-Werror]
       ((term_char == '/' || term_char == NULL) &&
                                       ^~

isreloc.c: In function 'has_rel_path':
isreloc.c:140:13: error: comparison between pointer and integer [-Werror]
  if (*entry == NULL || strchr(IGNORE_START, *entry))
             ^~
isreloc.c:161:13: error: comparison between pointer and integer [-Werror]
  if (*entry == NULL || strchr(IGNORE_TYPE, *entry))
             ^~
isreloc.c:175:37: error: comparison between pointer and integer [-Werror]
  } while (++entry_pos < 3 && *entry != NULL);
                                     ^~

fixpath.c: In function 'orig_path_ptr':
fixpath.c:319:14: error: comparison between pointer and integer [-Werror]
    if (*retv == NULL)
              ^~
cc1: all warnings being treated as errors

  

Issues

  • 0
  • 3
  • 0
  • 3
Description From Last Updated
Andy Fiddaman
Andy Fiddaman
Ship It!
Loading...