10309 mkstr: NULL pointer errors

Review Request #1402 - Created Jan. 27, 2019 and submitted

Information
Toomas Soome
illumos-gate
10309
20b62a3...
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 mkstr.c:56:
mkstr.c: In function 'copystr':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 3 of 'hashit' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
mkstr.c:240:37: note: in expansion of macro 'NULL'
  (void) printf("%d", hashit(buf, 1, NULL));
                                     ^~~~
mkstr.c:75:12: note: expected 'unsigned int' but argument is of type 'void *'
 static int hashit(char *str, char really, unsigned int fakept);
            ^~~~~~
mkstr.c: In function 'inithash':
mkstr.c:257:46: error: comparison between pointer and integer [-Werror]
  while (fgetNUL(buf, sizeof (buf), mesgread) != NULL) {
                                              ^~
mkstr.c: In function 'fgetNUL':
mkstr.c:318:46: error: pointer/integer type mismatch in conditional expression [-Werror]
  return ((feof(file) || ferror(file)) ? NULL : 1);
                                              ^
mkstr.c:318:46: error: return makes integer from pointer without a cast [-Werror=int-conversion]
  return ((feof(file) || ferror(file)) ? NULL : 1);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
cc1: all warnings being treated as errors

  

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Robert Mustacchi
Andrew Stormont
Gergő Mihály Doma
Toomas Soome
Andrew Stormont
Robert Mustacchi
Toomas Soome
Review request changed

Status: Closed (submitted)

Loading...