Project

General

Profile

Bug #11324

expr: 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 expr.c:29:
expr.c: In function 'ematch':
/code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 3 of 'mbstowcs' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
expr.c:444:41: note: in expansion of macro 'NULL'
   if ((nmbchars = mbstowcs(NULL, tmptr, NULL)) == -1) {
                                         ^~~~
In file included from /code/illumos-gate/proto/root_i386/usr/include/stdlib.h:37:0,
                 from expr.c:29:
/code/illumos-gate/proto/root_i386/usr/include/iso/stdlib_iso.h:144:15: note: expected 'size_t {aka unsigned int}' but argument is of type 'void *'
 extern size_t mbstowcs(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
               ^~~~~~~~

../expr/compile.c: In function 'dhl_compile':
../expr/compile.c:152:16: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  if (*instr == (char) NULL) {
                ^
cc1: all warnings being treated as errors

Also available in: Atom PDF