Replace forced null pointer assignment with abort()

Gets rid of this warning:

  error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
This commit is contained in:
Martin Natano
2022-05-31 09:29:53 -07:00
parent 699ef6fdbe
commit 5f9f0608c2
+3 -2
View File
@@ -1,5 +1,7 @@
#include "global.h"
#include <cstdlib>
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
@@ -15,7 +17,6 @@
# endif
#elif defined(MACOSX)
# include "archutils/Darwin/Crash.h"
# include <stdlib.h>
using CrashHandler::IsDebuggerPresent;
using CrashHandler::DebugBreak;
#endif
@@ -38,7 +39,7 @@ void NORETURN sm_crash( const char *reason )
#if defined(CRASH_HANDLER)
CrashHandler::ForceCrash( reason );
#else
*(char*)0=0;
std::abort();
/* This isn't actually reached. We just do this to convince the compiler that the
* function really doesn't return. */