Project

General

Profile

Bug #8416

abd.h is not C++ friendly

Added by Andriy Gapon over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2017-06-21
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

A C++ compiler fails to compile abd_is_linear(), which is an inline function defined in abd.h, with the following error:

error: cannot initialize return object of type 'boolean_t' with an rvalue of type 'bool'

That happens because a bool can not be converted to an enum in C++.
That's a problem because abd.h can be visible through other header files that a C++ program that works with ZFS can include.

History

#1

Updated by Electric Monk about 2 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit 5e2a074725cb7c16ea1c6554da11ab4d6b4e7aee

commit  5e2a074725cb7c16ea1c6554da11ab4d6b4e7aee
Author: Andriy Gapon <avg@FreeBSD.org>
Date:   2017-06-29T23:10:40.000Z

    8416 abd.h is not C++ friendly
    Reviewed by: Igor Kozhukhov <igor@dilos.org>
    Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
    Reviewed by: Alek Pinchuk <pinchuk.alek@gmail.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF