public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] sim/ppc: mark device_error function as ATTRIBUTE_NORETURN
@ 2022-10-19 13:32 Andrew Burgess
0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2022-10-19 13:32 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e5961d2be503149aaa40927c0a9501c06ca980e5
commit e5961d2be503149aaa40927c0a9501c06ca980e5
Author: Andrew Burgess <aburgess@redhat.com>
Date: Wed Oct 12 11:14:26 2022 +0100
sim/ppc: mark device_error function as ATTRIBUTE_NORETURN
The device_error function always ends up calling the error function,
which is itself marked as ATTRIBUTE_NORETURN, so it makes sense that
device_error should also be marked ATTRIBUTE_NORETURN.
Doing this resolves a few warnings from hw_ide.c about possibly
uninitialized variables - the variables are only uninitialized after
passing through a call to device_error, which obviously means the
variables are never really used uninitialized, the simulation will
terminate with the device_error call.
Diff:
---
sim/ppc/device.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sim/ppc/device.h b/sim/ppc/device.h
index bd539095160..65c85e4ddd3 100644
--- a/sim/ppc/device.h
+++ b/sim/ppc/device.h
@@ -729,7 +729,7 @@ EXTERN_DEVICE\
(void) device_error
(device *me,
const char *fmt,
- ...) ATTRIBUTE_PRINTF_2;
+ ...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_2;
INLINE_DEVICE\
(int) device_trace
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-19 13:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 13:32 [binutils-gdb] sim/ppc: mark device_error function as ATTRIBUTE_NORETURN Andrew Burgess
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).