[3/5] sim/ppc: mark device_error function as ATTRIBUTE_NORETURN

Message ID 39eeb655ef7a1a8b3ea3c2f120e7d67693ec3f93.1665578246.git.aburgess@redhat.com
State Committed
Commit e5961d2be503149aaa40927c0a9501c06ca980e5
Headers
Series Silence some build warnings in various simulators |

Commit Message

Andrew Burgess Oct. 12, 2022, 12:38 p.m. UTC
  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.
---
 sim/ppc/device.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

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