public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH/committed] sim: cgen: mark cgen_rtx_error noreturn
@ 2023-12-24 10:09 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2023-12-24 10:09 UTC (permalink / raw)
  To: gdb-patches

Since this function never returns, mark it as such to fix some unused
variable warnings in error code paths.

For example, cris triggers:
sim/cris/semcrisv10f-switch.c:3558:11: error:
	variable 'tmp_newval' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]

Even though it has an "else" path that calls this error function.
---
 sim/common/cgen-ops.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sim/common/cgen-ops.h b/sim/common/cgen-ops.h
index 8c880fe54234..552ff5998275 100644
--- a/sim/common/cgen-ops.h
+++ b/sim/common/cgen-ops.h
@@ -705,6 +705,6 @@ SUBOFDI (DI a, DI b, BI c)
 
 #endif
 
-extern void cgen_rtx_error (SIM_CPU *, const char *);
+extern void cgen_rtx_error (SIM_CPU *, const char *) ATTRIBUTE_NORETURN;
 
 #endif /* CGEN_SEM_OPS_H */
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-24 10:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-24 10:09 [PATCH/committed] sim: cgen: mark cgen_rtx_error noreturn Mike Frysinger

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).