Skip to content

Compilation fails with clang19Β #988

@outpaddling

Description

@outpaddling

Salmon 1.10.2 and 1.10.3 both fail to compile with clang19 (under FreeBSD 13.5 and 14.3). They build fine under clang18.

The first problem I hit was in external/pufferfish/external/twopaco/graphconstructor/candidateoccurence.h and seems to be due to the fact that atomic objects are not copyable.

/usr/ports/wip/salmon/work/salmon-1.10.3/external/pufferfish/external/twopaco/graphconstructor/candidateoccurence.h:61:11: error: overload resolution selected deleted operator '='
   61 |                         count_ = toCopy.count_;
      |                         ~~~~~~ ^ ~~~~~~~~~~~~~
/usr/include/c++/v1/__atomic/atomic.h:58:11: note: candidate function has been explicitly deleted
   58 |   atomic& operator=(const atomic&)          = delete;
      |           ^
/usr/include/c++/v1/__atomic/atomic.h:59:11: note: candidate function has been explicitly deleted
   59 |   atomic& operator=(const atomic&) volatile = delete;
      |           ^
/usr/include/c++/v1/__atomic/atomic.h:49:29: note: candidate function           
   49 |   _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __d) volatile _NOEXCEPT {
      |                             ^
/usr/include/c++/v1/__atomic/atomic.h:53:29: note: candidate function           
   53 |   _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __d) _NOEXCEPT {
      |                             ^
1 error generated.                                                              
gmake[2]: *** [external/pufferfish/external/twopaco/graphconstructor/CMakeFiles/

I worked around it with the following patch:

--- external/pufferfish/external/twopaco/graphconstructor/candidateoccurence.h.orig     2025-07-26 13:01:27 UTC
+++ external/pufferfish/external/twopaco/graphconstructor/candidateoccurence.h
@@ -58,7 +58,7 @@ namespace TwoPaCo
                const CandidateOccurence & operator = (const CandidateOccurence & toCopy)
                {
                        body_ = toCopy.body_;
-                       count_ = toCopy.count_;
+                       count_.store(toCopy.count_.load(std::memory_order_relaxed));
                }
 
                void Inc()

I then hit the same error describe in #987.

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