Project

General

Profile

Bug #11295

lp: NULL pointer errors

Added by Toomas Soome over 1 year ago. Updated over 1 year ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with NULL pointer:

    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 netpr.c:26:
    netpr.c: In function 'net_open':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    netpr.c:92:30: note: in expansion of macro 'NULL'
      (void) memset((char *)&sin, NULL, sizeof (sin));
                                  ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from netpr.c:32:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdlib_iso.h:50:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdlib.h:37,
                     from lpfsck.c:33:
    lpfsck.c: In function 'va_makepath':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    lpfsck.c:326:14: note: in expansion of macro 'NULL'
      memset(buf, NULL, sizeof (buf));
                  ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from lpsched.h:34,
                     from lpfsck.c:36:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~

    fncs.c: In function 'GetRequestFiles':
    fncs.c:901:11: error: comparison between pointer and integer [-Werror]
      if (*buf == NULL || !strncmp(buf, SPOOLDIR, sizeof(SPOOLDIR)-1))
               ^~

    iles.c: In function 'rmfiles':
    files.c:175:10: error: assignment makes integer from pointer without a cast 
[-Werror=int-conversion]
           *q = NULL;
              ^

    exec.c: In function 'clean_string':
    exec.c:117:21: error: comparison between pointer and integer [-Werror]
      for (cp = ptr; *cp != NULL; ) {
                         ^~
    exec.c: In function 'exec':
    exec.c:741:35: error: comparison between pointer and integer [-Werror]
        for (ct_p = clean_title; *ct_p != NULL; ct_p++) {
                                       ^~

    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 dispatch.h:32,
                     from disp1.c:29:
    disp1.c: In function 's_pass_peer_connection':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    disp1.c:1164:19: note: in expansion of macro 'NULL'
      memset(&recv_fd, NULL, sizeof (recv_fd));
                       ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from lpsched.h:34,
                     from dispatch.h:34,
                     from disp1.c:29:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~

    ppd.c: In function 'process_line':
    ppd.c:57:9: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *ptr++ = NULL;
             ^
    ppd.c:67:10: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *ptr++ = NULL;
              ^
    ppd.c:78:10: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *ptr++ = NULL;
              ^
    ppd.c: In function 'PPDFileToAttributesList':
    ppd.c:110:10: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        *text = NULL;
              ^

    lpsched-misc.c: In function 'papiAttributeListAddLPString':
    lpsched-misc.c:44:16: error: comparison between pointer and integer [-Werror]
          (value[0] != NULL))
                    ^~
    lpsched-misc.c: In function 'printer_name_from_uri_id':
    lpsched-misc.c:122:17: error: comparison between pointer and integer [-Werror]
      if ((result[0] == NULL) && (id != -1)) {
                     ^~

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdlib_iso.h:50:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdlib.h:37,
                     from lpsched-jobs.c:28:
    lpsched-jobs.c: In function 'job_attributes_to_lpsched_request':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    lpsched-jobs.c:106:14: note: in expansion of macro 'NULL'
      memset(tmp, NULL, sizeof (tmp));
                  ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from lpsched-jobs.c:29:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    lpsched-jobs.c: In function 'lpsched_user_to_job_attributes':
    lpsched-jobs.c:372:51: error: comparison between pointer and integer [-Werror]
      if ((list != NULL) && (user != NULL) && (user[0] != NULL)) {
                                                       ^~
    lpsched-jobs.c:376:10: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        *host = NULL;
              ^

    job.c: In function 'papiJobQuery':
    job.c:974:45: error: comparison between pointer and integer [-Werror]
      if ((request_id == NULL) || (request_id[0] == 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 files.c:34:
    files.c: In function 'fdgets':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    files.c:99:14: note: in expansion of macro 'NULL'
      memset(buf, NULL, len);
                  ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from files.c:36:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~

    postprint.c: In function 'options':
    postprint.c:310:40: error: comparison between pointer and integer [-Werror]
             if ((strstr(locale, "8859-15") != NULL) ||
                                            ^~
    postprint.c:311:30: error: comparison between pointer and integer [-Werror]
          (strstr(locale, "euro") != NULL))
                                  ^~

    postreverse.c: In function 'ParsePageList':
    postreverse.c:257:11: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
         *s2++ = NULL;
               ^
    cc1: all warnings being treated as errors

#1

Updated by Toomas Soome over 1 year ago

  • Description updated (diff)
#2

Updated by Electric Monk over 1 year ago

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

git commit e4fb8a5fd5bb5a5d316430c6ac8f6d33704fcf5d

commit  e4fb8a5fd5bb5a5d316430c6ac8f6d33704fcf5d
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-06T14:24:06.000Z

    11295 lp: NULL pointer errors
    Reviewed by: C Fraire <cfraire@me.com>
    Approved by: Garrett D'Amore <garrett@damore.org>

Also available in: Atom PDF