Workaround compiler warnings at -O1
authorPaul Brook <paul@codesourcery.com>
Sat, 9 May 2009 22:21:39 +0000 (23:21 +0100)
committerPaul Brook <paul@codesourcery.com>
Sat, 9 May 2009 22:22:35 +0000 (23:22 +0100)
Signed-off-by: Paul Brook <paul@codesourcery.com>
qemu-io.c

index 60464e6aba92f8c2b454b26e41a0ee0db3099f8e..f0a17b98680c4bb2b5417099b653a96a05793c10 100644 (file)
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -210,7 +210,9 @@ read_f(int argc, char **argv)
        int c, cnt;
        char *buf;
        int64_t offset;
-       int count, total;
+       int count;
+        /* Some compilers get confused and warn if this is not initialized.  */
+        int total = 0;
        int pattern = 0, pattern_offset = 0, pattern_count = 0;
 
        while ((c = getopt(argc, argv, "Cl:pP:qs:v")) != EOF) {
@@ -527,7 +529,9 @@ write_f(int argc, char **argv)
        int c, cnt;
        char *buf;
        int64_t offset;
-       int count, total;
+       int count;
+        /* Some compilers get confused and warn if this is not initialized.  */
+        int total = 0;
        int pattern = 0xcd;
 
        while ((c = getopt(argc, argv, "CpP:q")) != EOF) {