[PATCH] D75795: [libc++abi] Change __cxa_finalize return type to void

Ryan Prichard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 14:44:38 PDT 2020


rprichard added a comment.

I think I'm fine with this revision. I was wondering if the two functions should be removed from the GNU libsupc++'s cxxabi.h as well, which also declares both of the functions with an `int` return type. (i.e. It has the same issue as LLVM's cxxabi.h.)

Aside: I noticed that libcxxrt, another implementation of the C++ ABI library, has a cxxabi.h without `__cxa_atexit` and `__cxa_finalize` declarations. libcxxrt does have implementations of those two APIs, but only for `__sun__` targets. The `__sun__` `__cxa_finalize` has a `void` return type, as expected.



================
Comment at: libcxxabi/include/cxxabi.h:141
+// These functions are part of the C++ ABI, but they are not defined in libc++abi:
+//    void __cxa_atexit(void (*)(void *), void *, void *);
+//    void __cxa_finalize(void *);
----------------
The return type of __cxa_atexit should remain as `int`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75795/new/

https://reviews.llvm.org/D75795



More information about the llvm-commits mailing list