Skip to content

Commit 73ff541

Browse files
authored
docs: Add warning about using std::counting_semaphore (#5595)
This adds a comment to avoid using `std::counting_semaphore` until the minimum compiler versions of GCC and Clang have been updated to no longer contain the bug that is present in older compilers.
1 parent 08b1365 commit 73ff541

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/xrpld/core/detail/semaphore.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,34 @@
1717
*/
1818
//==============================================================================
1919

20+
/**
21+
*
22+
* TODO: Remove ripple::basic_semaphore (and this file) and use
23+
* std::counting_semaphore.
24+
*
25+
* Background:
26+
* - PR: https://github.com/XRPLF/rippled/pull/5512/files
27+
* - std::counting_semaphore had a bug fixed in both GCC and Clang:
28+
* * GCC PR 104928: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104928
29+
* * LLVM PR 79265: https://github.com/llvm/llvm-project/pull/79265
30+
*
31+
* GCC:
32+
* According to GCC Bugzilla PR104928
33+
* (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104928#c15), the fix is
34+
* scheduled for inclusion in GCC 16.0 (see comment #15, Target
35+
* Milestone: 16.0). It is not included in GCC 14.x or earlier, and there is no
36+
* indication that it will be backported to GCC 13.x or 14.x branches.
37+
*
38+
* Clang:
39+
* The fix for is included in Clang 19.1.0+
40+
*
41+
* Once the minimum compiler version is updated to > GCC 16.0 or Clang 19.1.0,
42+
* we can remove this file.
43+
*
44+
* WARNING: Avoid using std::counting_semaphore until the minimum compiler
45+
* version is updated.
46+
*/
47+
2048
#ifndef RIPPLE_CORE_SEMAPHORE_H_INCLUDED
2149
#define RIPPLE_CORE_SEMAPHORE_H_INCLUDED
2250

0 commit comments

Comments
 (0)