Project

General

Profile

Bug #11324

expr: NULL pointer errors

Added by Toomas Soome 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

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

History

#1

Updated by Electric Monk 3 months ago

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

git commit 023a3eeed3dc3724c83a2c43af879ce1719b2e32

commit  023a3eeed3dc3724c83a2c43af879ce1719b2e32
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-08T18:01:43.000Z

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

Also available in: Atom PDF