Adding throw() after __cxa_atexit redefinition conflicts with cxxabi.h prototype #144

Open
opened 2023-12-29 02:22:46 -06:00 by Torrekie · 0 comments
Torrekie commented 2023-12-29 02:22:46 -06:00 (Migrated from github.com)
ld.cpp:1702:16: error: exception specification in declaration does not match previous declaration
extern "C" int __cxa_atexit(void (*func) (void *), void * arg, void * dso_handle) CXA_ATEXIT_THROW;
               ^
/usr/bin/../include/c++/v1/cxxabi.h:140:32: note: previous declaration is here
extern _LIBCXXABI_FUNC_VIS int __cxa_atexit(void (*f)(void *), void *p,
                               ^
18 warnings and 1 error generated.

Latest llvm has been removed __cxa_atexit prototype from cxxabi.h so that this code works, but not for older llvm. Besides, Apple did not add throw() to the redefinition in the original code of ld.cpp

Possible patch is define CXA_ATEXIT_THROW as nothing when __APPLE__

``` ld.cpp:1702:16: error: exception specification in declaration does not match previous declaration extern "C" int __cxa_atexit(void (*func) (void *), void * arg, void * dso_handle) CXA_ATEXIT_THROW; ^ /usr/bin/../include/c++/v1/cxxabi.h:140:32: note: previous declaration is here extern _LIBCXXABI_FUNC_VIS int __cxa_atexit(void (*f)(void *), void *p, ^ 18 warnings and 1 error generated. ``` Latest llvm has been removed `__cxa_atexit` prototype from cxxabi.h so that this code works, but not for older llvm. Besides, Apple did not add `throw()` to the redefinition in the original code of ld.cpp Possible patch is define `CXA_ATEXIT_THROW` as nothing when `__APPLE__`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
miles/cctools-port#144
No description provided.