Message ID | 20210201002410.46501-1-xypron.glpk@gmx.de |
---|---|
State | Accepted |
Commit | c30a7093e81be0dbec963b6b347f678630c2eb8d |
Delegated to: | Simon Glass |
Headers | show |
Series | [v2,1/1] sandbox: mark os_abort() as noreturn | expand |
On Sun, 31 Jan 2021 at 17:24, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote: > > gcc -fanalyzer needs the information that a function does not return to > provide accurate information. > > os_abort() does not return. Mark it accordingly. > > Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> > --- > v2: > use __attribute__((noreturn)) instead of __return > --- > include/os.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Simon Glass <sjg@chromium.org>
On Sun, 31 Jan 2021 at 17:24, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote: > > gcc -fanalyzer needs the information that a function does not return to > provide accurate information. > > os_abort() does not return. Mark it accordingly. > > Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> > --- > v2: > use __attribute__((noreturn)) instead of __return > --- > include/os.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Simon Glass <sjg@chromium.org> Applied to u-boot-dm, thanks!
diff --git a/include/os.h b/include/os.h index e192e32d59..65bcb232ca 100644 --- a/include/os.h +++ b/include/os.h @@ -341,7 +341,7 @@ void os_localtime(struct rtc_time *rt); /** * os_abort() - raise SIGABRT to exit sandbox (e.g. to debugger) */ -void os_abort(void); +void os_abort(void) __attribute__((noreturn)); /** * os_mprotect_allow() - Remove write-protection on a region of memory
gcc -fanalyzer needs the information that a function does not return to provide accurate information. os_abort() does not return. Mark it accordingly. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> --- v2: use __attribute__((noreturn)) instead of __return --- include/os.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.29.2