qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] mips_fulong2e: Detect format errors for function prom_set
@ 2010-09-11  6:46 Stefan Weil
  2010-09-11  6:46 ` [Qemu-devel] [PATCH] mips_malta: " Stefan Weil
  2010-09-20 19:03 ` [Qemu-devel] [PATCH] mips_fulong2e: " Blue Swirl
  0 siblings, 2 replies; 19+ messages in thread
From: Stefan Weil @ 2010-09-11  6:46 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Aurelien Jarno

Add the necessary gcc attribute and fix the detected errors.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 hw/mips_fulong2e.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/hw/mips_fulong2e.c b/hw/mips_fulong2e.c
index cbe7156..2ef5070 100644
--- a/hw/mips_fulong2e.c
+++ b/hw/mips_fulong2e.c
@@ -77,6 +77,8 @@ static struct _loaderparams {
 } loaderparams;
 
 static void prom_set(uint32_t* prom_buf, int index, const char *string, ...)
+    __attribute__ ((format (gnu_printf, 3, 4)));
+static void prom_set(uint32_t* prom_buf, int index, const char *string, ...)
 {
     va_list ap;
     int32_t table_addr;
@@ -141,13 +143,13 @@ static int64_t load_kernel (CPUState *env)
     prom_size = ENVP_NB_ENTRIES * (sizeof(int32_t) + ENVP_ENTRY_SIZE);
     prom_buf = qemu_malloc(prom_size);
 
-    prom_set(prom_buf, index++, loaderparams.kernel_filename);
+    prom_set(prom_buf, index++, "%s", loaderparams.kernel_filename);
     if (initrd_size > 0) {
-        prom_set(prom_buf, index++, "rd_start=0x" PRIx64 " rd_size=%li %s",
+        prom_set(prom_buf, index++, "rd_start=0x%" PRIx64 " rd_size=%li %s",
                  cpu_mips_phys_to_kseg0(NULL, initrd_offset), initrd_size,
                  loaderparams.kernel_cmdline);
     } else {
-        prom_set(prom_buf, index++, loaderparams.kernel_cmdline);
+        prom_set(prom_buf, index++, "%s", loaderparams.kernel_cmdline);
     }
 
     /* Setup minimum environment variables */
-- 
1.7.0.4

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

end of thread, other threads:[~2010-09-22 20:31 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-11  6:46 [Qemu-devel] [PATCH] mips_fulong2e: Detect format errors for function prom_set Stefan Weil
2010-09-11  6:46 ` [Qemu-devel] [PATCH] mips_malta: " Stefan Weil
2010-09-13 20:02   ` [Qemu-devel] [PATCH 1/2] Add support for gcc format attribute gnu_printf Stefan Weil
2010-09-20 19:18     ` Blue Swirl
2010-09-20 21:03       ` Stefan Weil
2010-09-20 21:05       ` [Qemu-devel] [PATCH] Move macros GCC_ATTR and GCC_FMT_ATTR to common header file Stefan Weil
2010-09-21 17:46         ` [Qemu-devel] " Stefan Weil
2010-09-21 17:48           ` [Qemu-devel] " Stefan Weil
2010-09-21 18:17             ` [Qemu-devel] " Blue Swirl
2010-09-21 20:27               ` [Qemu-devel] " Stefan Weil
2010-09-22 20:30                 ` [Qemu-devel] " Blue Swirl
2010-09-13 20:02   ` [Qemu-devel] [PATCH 2/2] Use new gcc format attribute gnu_printf Stefan Weil
2010-09-20 18:53     ` Blue Swirl
2010-09-20 19:04   ` [Qemu-devel] [PATCH] mips_malta: Detect format errors for function prom_set Blue Swirl
2010-09-20 19:03 ` [Qemu-devel] [PATCH] mips_fulong2e: " Blue Swirl
2010-09-20 20:18   ` [Qemu-devel] [PATCH 1/2] mips_fulong2e: Fix format strings Stefan Weil
2010-09-21 19:48     ` [Qemu-devel] " Blue Swirl
2010-09-20 20:18   ` [Qemu-devel] [PATCH 2/2] mips_malta: " Stefan Weil
2010-09-21 19:48     ` [Qemu-devel] " Blue Swirl

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 NNTP newsgroup(s).