summaryrefslogtreecommitdiff
path: root/qemu-common.h
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-14 19:00:36 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-14 19:00:36 +0000
commit7d99a001df854ef950a128000cbd982c4f6cd616 (patch)
treee52f08091024cbbcdf4c08810d76ca27d1b808cb /qemu-common.h
parentfdf7ed965281f7d68029580f6a652fa918018dbf (diff)
downloadqemu-7d99a001df854ef950a128000cbd982c4f6cd616.tar.gz
Add noreturn function attribute
Introduce noreturn attribute and attach it to cpu_loop_exit as well as interrupt/exception helpers for i386. This avoids a bunch of gcc4 warnings. [ Note that this patch comes with a workaround to include qemu-common.h even in cases where is currently causes conflicts with dyngen-exec.h. I've been told that these conflicts will get resolved in the future (/me will try to have a look as well - as time permits). ] Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6303 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'qemu-common.h')
-rw-r--r--qemu-common.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/qemu-common.h b/qemu-common.h
index d3df63ea01..6ee31e0788 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -2,6 +2,13 @@
#ifndef QEMU_COMMON_H
#define QEMU_COMMON_H
+#define noreturn __attribute__ ((__noreturn__))
+
+/* Hack around the mess dyngen-exec.h causes: We need noreturn in files that
+ cannot include the following headers without conflicts. This condition has
+ to be removed once dyngen is gone. */
+#ifndef __DYNGEN_EXEC_H__
+
/* we put basic includes here to avoid repeating them in device drivers */
#include <stdlib.h>
#include <stdio.h>
@@ -134,9 +141,8 @@ void *get_mmap_addr(unsigned long size);
/* Error handling. */
-void hw_error(const char *fmt, ...)
- __attribute__ ((__format__ (__printf__, 1, 2)))
- __attribute__ ((__noreturn__));
+void noreturn hw_error(const char *fmt, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
/* IO callbacks. */
typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
@@ -179,4 +185,6 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id);
/* Force QEMU to stop what it's doing and service IO */
void qemu_service_io(void);
+#endif /* dyngen-exec.h hack */
+
#endif