Project

General

Profile

Actions

Bug #11336

closed

find: NULL pointer errors

Added by Toomas Soome almost 3 years ago. Updated almost 3 years 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 find.c:41:
    /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)
                  ^
    find.c:161:2: note: in expansion of macro 'NULL'
      NULL,  0,  0
      ^~~~
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: note: (near initialization for 'commands[51].name[0]')
     #define NULL ((void *)0)
                  ^
    find.c:161:2: note: in expansion of macro 'NULL'
      NULL,  0,  0
      ^~~~
    find.c: In function 'compile':
    find.c:664:20: error: comparison between pointer and integer [-Werror]
        if (readmode(b) != 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 find.c:41:
    find.c: In function 'execute':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 5 of 'regexec' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    find.c:1133:49: note: in expansion of macro 'NULL'
        if (regexec(&preg[cnpreg], name, 1, &pmatch, NULL) == 0)
                                                     ^~~~
    In file included from find.c:62:0:
    /code/illumos-gate/proto/root_i386/usr/include/regex.h:161:12: note: expected 'int' but argument is of type 'void *'
     extern int regexec(const regex_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
                ^~~~~~~
    find.c: In function 'readmode':
    find.c:2073:9: error: return makes integer from pointer without a cast [-Werror=int-conversion]
      return (NULL);
             ^
    cc1: all warnings being treated as errors

Actions #1

Updated by Electric Monk almost 3 years ago

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

git commit 27d3a16929acf0d6b894b2210438d0d6915826fe

commit  27d3a16929acf0d6b894b2210438d0d6915826fe
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-11T15:10:29.000Z

    11336 find: NULL pointer errors
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF