Project

General

Profile

Bug #10424

uts: NULL pointer errors in DEBUG build

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
2019-02-19
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

With NULL pointer, we get build errors in debug build:

In file included from ../../common/sys/model.h:35:0,
                 from ../../common/sys/resource.h:221,
                 from ../../common/sys/user.h:73,
                 from ../../common/sys/proc.h:36,
                 from ../../common/sys/systm.h:40,
                 from ../../common/sys/conf.h:56,
                 from ../../common/os/bio.c:47:
../../common/os/bio.c: In function 'getblk_common':
../../common/os/bio.c:645:36: error: comparison between pointer and integer [-We
rror]
   ASSERT((bp->b_flags & B_NOCACHE) == NULL);
                                    ^
../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
 #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                             ^~
../../common/os/bio.c:719:36: error: comparison between pointer and integer [-We
rror]
  ASSERT((nbp->b_flags & B_NOCACHE) == NULL);
                                    ^
../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
 #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                             ^~

../../common/os/taskq.c: In function 'taskq_dispatch':
../../common/os/taskq.c:713:10: error: return makes integer from pointer without
 a cast [-Werror=int-conversion]
   return (NULL);     \
          ^
../../common/os/taskq.c:1165:3: note: in expansion of macro 'TASKQ_S_RANDOM_DISP
ATCH_FAILURE'
   TASKQ_S_RANDOM_DISPATCH_FAILURE(tq, flags);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../common/os/taskq.c:703:10: error: return makes integer from pointer without
 a cast [-Werror=int-conversion]
   return (NULL);     \
          ^
../../common/os/taskq.c:1188:2: note: in expansion of macro 'TASKQ_D_RANDOM_DISP
ATCH_FAILURE'
  TASKQ_D_RANDOM_DISPATCH_FAILURE(tq, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
*** Error code 1

History

#1

Updated by Electric Monk 5 months ago

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

git commit a8b4e7c71a6c1ef07e77c48dbb92fcdc8624266d

commit  a8b4e7c71a6c1ef07e77c48dbb92fcdc8624266d
Author: Toomas Soome <tsoome@me.com>
Date:   2019-02-20T22:38:14.000Z

    10424 uts: NULL pointer errors in DEBUG build
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Reviewed by: Gergő Doma <domag02@gmail.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF