11336 find: NULL pointer errors

Review Request #2072 - Created July 6, 2019 and submitted

Information
Toomas Soome
illumos-gate
11336
5bb8ed6...
Reviewers
general
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

  
Andrew Stormont
Garrett D'Amore
Toomas Soome
Andrew Stormont
Toomas Soome
Review request changed

Status: Closed (submitted)

Loading...