[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/3] Replace remaining gcc format attribute by macro
From: |
Stefan Weil |
Subject: |
[Qemu-devel] [PATCH 2/3] Replace remaining gcc format attribute by macro GCC_FMT_ATTR (format checking) |
Date: |
Thu, 23 Sep 2010 21:28:04 +0200 |
Replace the remaining format attribute printf by macro
GCC_FMT_ATTR which uses gnu_printf (if supported).
This needs additional code changes:
* Add qemu-common.h (which defined GCC_FMT_ATTR) were needed.
* Remove standard includes when qemu-common.h was added.
qemu-common.h already provides these includes.
* Remove local definitions which now come from stdio.h.
These definitions were needed before tcg was introduced.
They raise conflicts when qemu-common.h is included.
Cc: Blue Swirl <address@hidden>
Signed-off-by: Stefan Weil <address@hidden>
---
cpu-all.h | 2 +-
cpu-exec.c | 2 ++
dyngen-exec.h | 9 ---------
target-alpha/op_helper.c | 1 +
target-arm/op_helper.c | 2 ++
target-cris/op_helper.c | 1 +
target-i386/op_helper.c | 1 +
target-m68k/op_helper.c | 2 ++
target-microblaze/op_helper.c | 2 +-
target-mips/op_helper.c | 3 ++-
target-ppc/op_helper.c | 3 ++-
target-sh4/op_helper.c | 4 ++--
target-sparc/op_helper.c | 1 +
13 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/cpu-all.h b/cpu-all.h
index 67a3266..11edddc 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -773,7 +773,7 @@ void cpu_dump_statistics (CPUState *env, FILE *f,
int flags);
void QEMU_NORETURN cpu_abort(CPUState *env, const char *fmt, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
+ GCC_FMT_ATTR(2, 3);
extern CPUState *first_cpu;
extern CPUState *cpu_single_env;
diff --git a/cpu-exec.c b/cpu-exec.c
index dbdfdcc..1cb36e0 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -16,6 +16,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
+#include "qemu-common.h"
#include "config.h"
#include "exec.h"
#include "disas.h"
diff --git a/dyngen-exec.h b/dyngen-exec.h
index 5bfef3f..97e2556 100644
--- a/dyngen-exec.h
+++ b/dyngen-exec.h
@@ -40,15 +40,6 @@
/* XXX: This may be wrong for 64-bit ILP32 hosts. */
typedef void * host_reg_t;
-#ifdef CONFIG_BSD
-typedef struct __sFILE FILE;
-#else
-typedef struct FILE FILE;
-#endif
-extern int fprintf(FILE *, const char *, ...);
-extern int fputs(const char *, FILE *);
-extern int printf(const char *, ...);
-
#if defined(__i386__)
#define AREG0 "ebp"
#elif defined(__x86_64__)
diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c
index ff5ae26..39a6a85 100644
--- a/target-alpha/op_helper.c
+++ b/target-alpha/op_helper.c
@@ -17,6 +17,7 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#include "qemu-common.h"
#include "exec.h"
#include "host-utils.h"
#include "softfloat.h"
diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
index 9b1a014..71cd8ff 100644
--- a/target-arm/op_helper.c
+++ b/target-arm/op_helper.c
@@ -16,6 +16,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
+#include "qemu-common.h"
#include "exec.h"
#include "helpers.h"
diff --git a/target-cris/op_helper.c b/target-cris/op_helper.c
index a60da94..9e21799 100644
--- a/target-cris/op_helper.c
+++ b/target-cris/op_helper.c
@@ -18,6 +18,7 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#include "qemu-common.h"
#include "exec.h"
#include "mmu.h"
#include "helper.h"
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index ec6b3e9..b1f3bf9 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -17,6 +17,7 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#include "qemu-common.h"
#include "exec.h"
#include "exec-all.h"
#include "host-utils.h"
diff --git a/target-m68k/op_helper.c b/target-m68k/op_helper.c
index 0711107..5c5fb5b 100644
--- a/target-m68k/op_helper.c
+++ b/target-m68k/op_helper.c
@@ -16,6 +16,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
+#include "qemu-common.h"
#include "exec.h"
#include "helpers.h"
diff --git a/target-microblaze/op_helper.c b/target-microblaze/op_helper.c
index 3d2b313..dd6e262 100644
--- a/target-microblaze/op_helper.c
+++ b/target-microblaze/op_helper.c
@@ -17,7 +17,7 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <assert.h>
+#include "qemu-common.h"
#include "exec.h"
#include "helper.h"
#include "host-utils.h"
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 41abd57..2429ff7 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -16,7 +16,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdlib.h>
+
+#include "qemu-common.h"
#include "exec.h"
#include "host-utils.h"
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 3e6db85..4692646 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -16,7 +16,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <string.h>
+
+#include "qemu-common.h"
#include "exec.h"
#include "host-utils.h"
#include "helper.h"
diff --git a/target-sh4/op_helper.c b/target-sh4/op_helper.c
index 2e5f555..fdc183c 100644
--- a/target-sh4/op_helper.c
+++ b/target-sh4/op_helper.c
@@ -16,8 +16,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <assert.h>
-#include <stdlib.h>
+
+#include "qemu-common.h"
#include "exec.h"
#include "helper.h"
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index be3c1e0..547793f 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -1,3 +1,4 @@
+#include "qemu-common.h"
#include "exec.h"
#include "host-utils.h"
#include "helper.h"
--
1.7.1