Skip to content

BDE Library built with GCC cannot be used with Clang #301

Open
@roe85

Description

@roe85

GCC and Clang are supposedly binary compatible.

However, it seems that the BDE library introduces compiler-dependent types in its public interface, which breaks this compatibility.

Specifically, when building the BDE library with GCC and attempting to consume it using Clang, the following linker error occurs: undefined reference to 'BloombergLP::bsls::Review::updateCount(BloombergLP::bsls::Atomic_TypeTraits<BloombergLP::bsls::AtomicOperations_ALL_ALL_ClangIntrinsics>::Int*)'

The issue is mainly due to one line in bdlt_datetime.h because it uses BSLS_REVIEW_INVOKE in the header. Other usages can be turned off with BSLS_REVIEW_LEVEL_NONE.

Is there (still) a reason why there is a Clang specific BloombergLP::bsls::AtomicOperations_ALL_ALL_ClangIntrinsics traits class?
The structure of the ifdef-ery in bsls_atomicoperations.h looks like Clang also should work with the GCC intrinsics, but the path is not reachable with current Clang versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions