aboutsummaryrefslogtreecommitdiff
path: root/libgloss/arm
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2018-10-01 15:52:42 +0000
committerRichard Earnshaw <Richard.Earnshaw@arm.com>2018-10-08 14:35:43 +0100
commit8a7536e91d7dc361adf9b66c4e14e9596c0b0ccc (patch)
tree503cdaa04804920694cd028186d3c0669c1ac17c /libgloss/arm
parentf53ce0112552166df728bafce57739756a304108 (diff)
downloadnewlib-8a7536e91d7dc361adf9b66c4e14e9596c0b0ccc.zip
newlib-8a7536e91d7dc361adf9b66c4e14e9596c0b0ccc.tar.gz
newlib-8a7536e91d7dc361adf9b66c4e14e9596c0b0ccc.tar.bz2
[ARM] Make _kill() a noreturn function.
AngelSWI_Reason_ReportException does not return accoring to the ARM documentation, so it is valid to mark _kill() as noreturn. This way, the compiler does not warn about _exit() returning a value despite being noreturn. 2018-10-01 Christophe Lyon <christophe.lyon@linaro.org> * libgloss/arm/_exit.c (_exit): Declare _kill() as noreturn. * libgloss/arm/_exit.c (_kill): Likewise. Remove the return statements. * newlib/libc/sys/arm/syscalls.c (_kill): Likewise..
Diffstat (limited to 'libgloss/arm')
-rw-r--r--libgloss/arm/_exit.c2
-rw-r--r--libgloss/arm/_kill.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/libgloss/arm/_exit.c b/libgloss/arm/_exit.c
index ca2d21c..4a071df 100644
--- a/libgloss/arm/_exit.c
+++ b/libgloss/arm/_exit.c
@@ -1,6 +1,6 @@
#include <_ansi.h>
-int _kill (int, int);
+int _kill (int, int) __attribute__((__noreturn__));
void _exit (int);
void
diff --git a/libgloss/arm/_kill.c b/libgloss/arm/_kill.c
index 278ded7..34a6ffd 100644
--- a/libgloss/arm/_kill.c
+++ b/libgloss/arm/_kill.c
@@ -2,7 +2,7 @@
#include <signal.h>
#include "swi.h"
-int _kill (int, int);
+int _kill (int, int) __attribute__((__noreturn__));
int
_kill (int pid, int sig)
@@ -41,12 +41,14 @@ _kill (int pid, int sig)
#if SEMIHOST_V2
if (_has_ext_exit_extended ())
- return do_AngelSWI (insn, block);
+ do_AngelSWI (insn, block);
else
#endif
- return do_AngelSWI (insn, (void*)block[0]);
+ do_AngelSWI (insn, (void*)block[0]);
#else
asm ("swi %a0" :: "i" (SWI_Exit));
#endif
+
+ __builtin_unreachable();
}