summaryrefslogtreecommitdiff
path: root/LibC
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-11-04 13:13:57 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-11-04 13:13:57 +0100
commit9bd09454e3fd78c7223e091cf58712a00763a708 (patch)
tree605844364a59d2dbb6eaba069322c75dbf595387 /LibC
parent8b4b684d6da2f2a3a885fc34ace202330e6806c5 (diff)
downloadserenity-9bd09454e3fd78c7223e091cf58712a00763a708.zip
Mark LibC's assertion faillure helper with __NORETURN.
Diffstat (limited to 'LibC')
-rw-r--r--LibC/assert.cpp3
-rw-r--r--LibC/assert.h2
-rw-r--r--LibC/sys/cdefs.h1
3 files changed, 3 insertions, 3 deletions
diff --git a/LibC/assert.cpp b/LibC/assert.cpp
index a8c499e1d0..7397c20a69 100644
--- a/LibC/assert.cpp
+++ b/LibC/assert.cpp
@@ -4,11 +4,10 @@
extern "C" {
-extern void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func)
+void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func)
{
fprintf(stderr, "ASSERTION FAILED: %s\n%s:%u in %s\n", msg, file, line, func);
abort();
}
}
-
diff --git a/LibC/assert.h b/LibC/assert.h
index e0a297a12a..546dcc90a7 100644
--- a/LibC/assert.h
+++ b/LibC/assert.h
@@ -4,7 +4,7 @@
__BEGIN_DECLS
-void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func);
+void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func) __NORETURN;
#define assert(expr) ((expr) ? (void)0 : __assertion_failed(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__))
#define CRASH() do { asm volatile("ud2"); } while(0)
diff --git a/LibC/sys/cdefs.h b/LibC/sys/cdefs.h
index 743ff03951..4bfbabedf1 100644
--- a/LibC/sys/cdefs.h
+++ b/LibC/sys/cdefs.h
@@ -1,6 +1,7 @@
#pragma once
#define ALWAYS_INLINE inline __attribute__ ((always_inline))
+#define __NORETURN __attribute__ ((noreturn))
#ifdef __cplusplus
#define __BEGIN_DECLS extern "C" {