MoonchildProductions#1251 - Part 13: Redefining abort in C++ requires extern "C"

I would ifdef this, but it's been in Firefox since version of 56, and Petr Sumbara's explanation as to why it's wrong in the first place is so detailed that it's pretty obvious the code wasn't technically doing things properly to begin with.

Basically, they tried to redefine a system function after including the header file that declares it, and it caused problems on Solaris because libc functions are imported into the C++ std namespace in a different way that also complies with standards. So the existing implementation is technically bad code on all platforms, the Solaris implementation just uncovered the lack of standards compliance in the Mozilla code.
athenian200 3 years ago committed by Roy Tam
parent 56c6d39d60
commit 5476f8090f
  1. 2

@ -68,7 +68,7 @@ void fillAbortMessage(char (&msg)[N], uintptr_t retAddress) {
// That segmentation fault will be interpreted as another bug by ASan and as a
// result, ASan will just exit(1) instead of aborting.
void abort(void)
extern "C" void abort(void)
char msg[64] = {};