https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114968

            Bug ID: 114968
           Summary: missing `__thiscall` attribute on builtin declaration
                    of `__cxa_thread_atexit()`
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lh_mouse at 126 dot com
  Target Milestone: ---

The builtin declaration lacks a `__thiscall` attribute on its first argument
(the callback) and conflicts with the libstdc++ declaration.

This issue has been introduced in eaeaad3fcac4d7a30b5a256410cb59fa1a3fa9dd.

This error is observed when building boost 1.48.

```
gcc.compile.c++
bin.v2\libs\stacktrace\build\gcc-14\release\pch-off\threadapi-win32\threading-multi\visibility-hidden\windbg_cached.o
<built-in>: error: conflicting declaration of C function 'int
__cxxabiv1::__cxa_thread_atexit(void (*)(), void*, void*)'
In file included from ./boost/core/demangle.hpp:32,
                 from ./boost/stacktrace/detail/frame_msvc.ipp:17,
                 from libs/stacktrace/build/../src/windbg_cached.cpp:10:
C:/msys64/mingw32/include/c++/14.0.1/cxxabi.h:140:3: note: previous declaration
'int __cxxabiv1::__cxa_thread_atexit(void (__attribute__((thiscall)) *)(void*),
void*, void*)'
  140 |   __cxa_thread_atexit(void (_GLIBCXX_CDTOR_CALLABI *)(void*), void*,
void *) _GLIBCXX_NOTHROW;
```

Reply via email to