diff --git a/include/bits/stdlib.h b/include/bits/stdlib.h
index fd13c94faf4bf84b610cf8dcf4f7bbd55c48d7b1..39e77647939173751a5b06f1bc0d0f9bbbc0a492 100644
--- a/include/bits/stdlib.h
+++ b/include/bits/stdlib.h
@@ -1,6 +1,10 @@
 #ifndef _BITS_STDLIB_H
 #define _BITS_STDLIB_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef __cplusplus
 // C++ needs abort to be a function, define backup function
 void abort(void);
@@ -9,10 +13,6 @@ void abort(void);
 #define abort() __abort(__func__, __FILE__, __LINE__)
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 long double strtold(const char *nptr, char **endptr);
 
 #ifdef __cplusplus
diff --git a/src/c/stdlib.c b/src/c/stdlib.c
index 3b58c0ccdcea4fb0345615e98446bf0f27795d87..57367c6bcd3d2c4ccd54e664e77294d04e99ff52 100644
--- a/src/c/stdlib.c
+++ b/src/c/stdlib.c
@@ -8,7 +8,7 @@ long double strtold(const char *nptr, char **endptr) {
 void __abort(const char *func, const char *file, int line);
 
 // backup definition of abort for programs that link it directly
-void abort() {
+void abort(void) {
     // call detailed abort function
     __abort(__func__, __FILE__, __LINE__);
 }