Project

General

Profile

Bug #11322

dfs.cmds: 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/stdlib_iso.h:50:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdlib.h:37,
                     from ../sharectl.c:29:
    ../sharectl.c: In function 'run_command':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'cmdvec->cmdfunc' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../sharectl.c:596:32: note: in expansion of macro 'NULL'
      ret = cmdvec->cmdfunc(handle, NULL, argc, argv);
                                    ^~~~
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: note: expected 'int' but argument is of type 'void *'
     #define NULL ((void *)0)
                  ^
    ../sharectl.c:596:32: note: in expansion of macro 'NULL'
      ret = cmdvec->cmdfunc(handle, NULL, argc, argv);
                                    ^~~~

    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 ../commands.c:28:
    /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)
                  ^
    ../commands.c:5900:18: note: in expansion of macro 'NULL'
      {NULL, 0, NULL, NULL}
                      ^~~~
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: note: (near initialization for 'commands[16].cmdidx')
     #define NULL ((void *)0)
                  ^
    ../commands.c:5900:18: note: in expansion of macro 'NULL'
      {NULL, 0, NULL, NULL}
                      ^~~~
    cc1: all warnings being treated as errors

#1

Updated by Electric Monk over 1 year ago

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

git commit 1a80a7c52201c03ace9f85bdb77b768062b06136

commit  1a80a7c52201c03ace9f85bdb77b768062b06136
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-08T17:57:00.000Z

    11322 dfs.cmds: NULL pointer errors
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF