Project

General

Profile

Bug #10305

print: NULL pointer errors

Added by Toomas Soome 11 months ago. Updated 10 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

When NULL defined as (void *)0:

    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 in.lpd.c:30:
    in.lpd.c: In function 'parse_cf':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    in.lpd.c:133:18: note: in expansion of macro 'NULL'
      char previous = NULL;
                      ^~~~
    in.lpd.c: In function 'berkeley_receive_files':
    in.lpd.c:512:17: error: comparison between pointer and integer [-Werror]
         while ((*cf != NULL) && (isdigit(*cf) == 0))
                     ^~

    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 cancel.c:30:
    cancel.c: In function 'main':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 4 of 'papiPrinterListJobs' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    cancel.c:203:15: note: in expansion of macro 'NULL'
             NULL, NULL, 0, &jobs);
                   ^~~~
    In file included from cancel.c:36:0:
    /code/illumos-gate/proto/root_i386/usr/include/papi.h:351:22: note: expected 'int' but argument is of type 'void *'
     extern papi_status_t papiPrinterListJobs(papi_service_t handle,
                          ^~~~~~~~~~~~~~~~~~~

    conv_fix.c: In function '_file_getline':
    conv_fix.c:67:10: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
         *tmp = NULL;
              ^

    lpset.c: In function 'main':
    lpset.c:276:38: error: comparison between pointer and integer [-Werror]
        for (p = key; ((p != NULL) && (*p != NULL)); p++)
                                          ^~
    lpset.c:278:9: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
          *p = NULL;
             ^
    lpset.c:284:35: error: comparison between pointer and integer [-Werror]
        if ((value != NULL) && (*value == NULL))
                                       ^~
    lpset.c:287:33: error: comparison between pointer and integer [-Werror]
        if ((key != NULL) && (key[0] != NULL)) {
                                     ^~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 10 months ago

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

git commit 5243e3342f14ea9f300eadae1c8524571a933a1b

commit  5243e3342f14ea9f300eadae1c8524571a933a1b
Author: Toomas Soome <tsoome@me.com>
Date:   2019-02-04T16:11:46.000Z

    10305 print: NULL pointer errors
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF