public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: add noreturn markings to more hw abort/halt funcs
@ 2011-01-09  2:14 Mike Frysinger
  2011-01-10 18:00 ` Doug Evans
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2011-01-09  2:14 UTC (permalink / raw)
  To: gdb-patches; +Cc: toolchain-devel

These functions either call abort() themselves, or call functions which
are already marked noreturn.  Either way, they don't return, so mark them
as such so calling code can assume this.  This fixes some uninitialized
warnings due to code paths that end in an abort function.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

2010-01-08  Mike Frysinger  <vapier@gentoo.org>

	* hw-device.h (hw_abort, hw_vabort, hw_halt): Add noreturn attribute.
	* sim-hw.h (sim_hw_abort): Likewise.
---
 sim/common/hw-device.h |    6 +++---
 sim/common/sim-hw.h    |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sim/common/hw-device.h b/sim/common/hw-device.h
index 4ac61b1..b0f66eb 100644
--- a/sim/common/hw-device.h
+++ b/sim/common/hw-device.h
@@ -433,17 +433,17 @@ int hw_ioctl
 void hw_abort
 (struct hw *me,
  const char *fmt,
- ...) __attribute__ ((format (printf, 2, 3)));
+ ...) __attribute__ ((format (printf, 2, 3), noreturn));
 
 void hw_vabort
 (struct hw *me,
  const char *fmt,
- va_list ap);
+ va_list ap) __attribute__ ((noreturn));
 
 void hw_halt
 (struct hw *me,
  int reason,
- int status);
+ int status) __attribute__ ((noreturn));
 
 
 #define hw_trace_p(hw) ((hw)->trace_of_hw_p + 0)
diff --git a/sim/common/sim-hw.h b/sim/common/sim-hw.h
index 1e0d3b3..e85cecc 100644
--- a/sim/common/sim-hw.h
+++ b/sim/common/sim-hw.h
@@ -49,7 +49,7 @@ void sim_hw_abort
 (SIM_DESC sd,
  struct hw *hw,
  const char *fmt,
- ...) __attribute__ ((format (printf, 3, 4)));
+ ...) __attribute__ ((format (printf, 3, 4), noreturn));
 
 
 
-- 
1.7.3.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sim: add noreturn markings to more hw abort/halt funcs
  2011-01-09  2:14 [PATCH] sim: add noreturn markings to more hw abort/halt funcs Mike Frysinger
@ 2011-01-10 18:00 ` Doug Evans
  2011-01-10 21:54   ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2011-01-10 18:00 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel

On Sat, Jan 8, 2011 at 6:14 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> These functions either call abort() themselves, or call functions which
> are already marked noreturn.  Either way, they don't return, so mark them
> as such so calling code can assume this.  This fixes some uninitialized
> warnings due to code paths that end in an abort function.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>
> 2010-01-08  Mike Frysinger  <vapier@gentoo.org>
>
>        * hw-device.h (hw_abort, hw_vabort, hw_halt): Add noreturn attribute.
>        * sim-hw.h (sim_hw_abort): Likewise.

This is ok.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sim: add noreturn markings to more hw abort/halt funcs
  2011-01-10 18:00 ` Doug Evans
@ 2011-01-10 21:54   ` Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2011-01-10 21:54 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches, toolchain-devel

On Mon, Jan 10, 2011 at 1:00 PM, Doug Evans wrote:
> On Sat, Jan 8, 2011 at 6:14 PM, Mike Frysinger wrote:
>> These functions either call abort() themselves, or call functions which
>> are already marked noreturn.  Either way, they don't return, so mark them
>> as such so calling code can assume this.  This fixes some uninitialized
>> warnings due to code paths that end in an abort function.
>>
>> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>>
>> 2010-01-08  Mike Frysinger  <vapier@gentoo.org>
>>
>>        * hw-device.h (hw_abort, hw_vabort, hw_halt): Add noreturn attribute.
>>        * sim-hw.h (sim_hw_abort): Likewise.
>
> This is ok.

committed then, thanks !
-mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-10 21:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-09  2:14 [PATCH] sim: add noreturn markings to more hw abort/halt funcs Mike Frysinger
2011-01-10 18:00 ` Doug Evans
2011-01-10 21:54   ` 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).