Skip to contentSkip to conversation

Trivial patches for 2013-11-25

GIT PULL Michael Tokarev 1 participant 4 messages Nov 25, 2013

lore
Share & tools
lore
#0 lore raw

Here are a few remaining bits from the trivial patches queue. Paolo already picked some so this time the queue is smaller than usual.

Please pull.

The following changes since commit c0caec178eadbbac4c672110c3914313091e0588:

Merge remote-tracking branch 'mst/tags/for_anthony' into staging (2013-11-25 09:49:43 -0800)

are available in the git repository at:

git://git.corpit.ru/qemu.git trivial-patches

for you to fetch changes up to a63ac076d7fc4c99632ad25a9c658b25e4f6ce32:

.gitignore: Ignore config.status (2013-11-25 23:33:21 +0400)

----------------------------------------------------------------
Fam Zheng (1):
.gitignore: Ignore config.status

Stefan Weil (2):
qobject: Fix compiler warning (missing gnu_printf format attribute)
acpi-build: Fix compiler warning (missing gnu_printf format attribute)

 .gitignore           |    1 +
 hw/i386/acpi-build.c |    5 +++--
 qobject/qerror.c     |    4 ++--
 3 files changed, 6 insertions(+), 4 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/3] qobject: Fix compiler warning (missing gnu_printf format attribute)

From: Stefan Weil <[email protected]>

gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra):

CC qobject/qerror.o
qobject/qerror.c: In function ‘qerror_from_info’:
qobject/qerror.c:53:5: error:
function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]

     qerr->err_msg = g_strdup_vprintf(fmt, *va);
     ^
---
 qobject/qerror.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
qobject/qerror.c +2 -2
index 3aee1cf..fc8331a 100644
@@ -42,8 +42,8 @@ static QError *qerror_new(void)
  *
  * Return strong reference.
  */
-static QError *qerror_from_info(ErrorClass err_class, const char *fmt,
-                                va_list *va)
+static QError * GCC_FMT_ATTR(2, 0)
+qerror_from_info(ErrorClass err_class, const char *fmt, va_list *va)
 {
     QError *qerr;
 
Signature · 1 line
1.7.10.4
#2 lore raw

[Qemu-devel] [PULL 3/3] .gitignore: Ignore config.status

In reply to Michael Tokarev

From: Fam Zheng <[email protected]>

---
 .gitignore |    1 +
 1 file changed, 1 insertion(+)
.gitignore +1 -0
index 5584b5f..1c9d63d 100644
@@ -3,6 +3,7 @@ config-all-devices.*
 config-all-disas.*
 config-host.*
 config-target.*
+config.status
 trace/generated-tracers.h
 trace/generated-tracers.c
 trace/generated-tracers-dtrace.h
Signature · 1 line
1.7.10.4
#3 lore raw

[Qemu-devel] [PULL 2/3] acpi-build: Fix compiler warning (missing gnu_printf format attribute)

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra):

CC m68k-softmmu/hw/m68k/mcf5206.o
hw/i386/acpi-build.c: In function ‘build_append_nameseg’:
hw/i386/acpi-build.c:294:5: error:
function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]

     g_string_vprintf(s, format, args);
     ^

When this warning is fixed, there is a new compiler warning:

CC i386-softmmu/hw/i386/acpi-build.o
hw/i386/acpi-build.c: In function ‘build_append_notify’:
hw/i386/acpi-build.c:632:5: error:
format not a string literal and no format arguments [-Werror=format-security]

     build_append_nameseg(method, name);
     ^

This is fixed here, too.

---
 hw/i386/acpi-build.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/i386/acpi-build.c +3 -2
index 5f36e7e..4d2e641 100644
@@ -285,7 +285,8 @@ static inline void build_append_array(GArray *array, GArray *val)
     g_array_append_vals(array, val->data, val->len);
 }
 
-static void build_append_nameseg(GArray *array, const char *format, ...)
+static void GCC_FMT_ATTR(2, 3)
+build_append_nameseg(GArray *array, const char *format, ...)
 {
     /* It would be nicer to use g_string_vprintf but it's only there in 2.22 */
     char s[] = "XXXX";
@@ -632,7 +633,7 @@ build_append_notify(GArray *device, const char *name,
     GArray *method = build_alloc_array();
     uint8_t op = 0x14; /* MethodOp */
 
-    build_append_nameseg(method, name);
+    build_append_nameseg(method, "%s", name);
     build_append_byte(method, 0x02); /* MethodFlags: ArgCount */
     for (i = skip; i < count; i++) {
         GArray *target = build_alloc_array();
Signature · 1 line
1.7.10.4