Project

General

Profile

Actions

Bug #8416

closed

abd.h is not C++ friendly

Added by Andriy Gapon over 6 years ago. Updated over 6 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
Gerrit CR:
External Bug:

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.

Actions #1

Updated by Electric Monk over 6 years ago

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

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>

Actions

Also available in: Atom PDF