opensolaris B_TRUE and B_FALSE

Ian Lepore freebsd at damnhippie.dyndns.org
Sun Oct 28 23:25:36 UTC 2012


On Mon, 2012-10-29 at 00:02 +0100, Erik Cederstrand wrote:
> Hello,
> 
> I'm looking at this Clang analyzer report: http://scan.freebsd.your.org/freebsd-head/WORLD/2012-10-24-amd64/report-uH6BjZ.html.gz#EndPath Apart from the actual error, which is a apse positive, it seems like Clang can't find the macro definitions for B_TRUE and B_FALSE (if it did, hovering over them would show the macro definition).
> 
> These are defined in sys/cddl/compat/opensolaris/sys/types.h as an enum of type boolean_t as long as _KERNEL is not defined. The only definition for boolean_t I can find is in sys/sys/types.h but it's only defined if _KERNEL is defined.
> 
> I'm sure that ZFS wouldn't work if B_TRUE or B_FALSE were undefined, I just can't figure out where it's happening. I need a hint :-)
> 
> Thanks,
> Erik

Look further up in sys/cddl/compat/opensolaris/sys/types.h, they're also
defined (as macros rather than enum) in the KERNEL case.  They're also
defined (as enum) in sys/gnu/fs/xfs/xfs_types.h.  (Once again, SlickEdit
pays for itself by answering with one right-click a question that would
have been a pain to use grep for.)

-- Ian




More information about the freebsd-hackers mailing list