bloomberg / bloomberg/bde

BDE Library built with GCC cannot be used with Clang

Open
#301 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.8k
Forks
342
PR merge metrics
No merged PRs in 30d

Description

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::Int*)'`

The issue is mainly due to one line in [bdlt_datetime.h](https://github.com/bloomberg/bde/blob/66d3fb1a7cde32d4d99307629bca504da22ab1e4/groups/bdl/bdlt/bdlt_datetime.h#L1136) 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.