]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Fix build with -DNDEBUG in CFLAGS
authorBlue Swirl <blauwirbel@gmail.com>
Sat, 13 Mar 2010 14:18:50 +0000 (14:18 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 13 Mar 2010 14:18:50 +0000 (14:18 +0000)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
block/vvfat.c
linux-user/signal.c
qdict.c
tcg/tcg.c

index bb707c000820319d5e1d131623223e4242b30121..aaa859335839e587b93cbd587fd2568dcb3be23c 100644 (file)
@@ -2462,10 +2462,13 @@ static int handle_commits(BDRVVVFATState* s)
            fail = -2;
            break;
        case ACTION_WRITEOUT: {
+#ifndef NDEBUG
+            /* these variables are only used by assert() below */
            direntry_t* entry = array_get(&(s->directory),
                    commit->param.writeout.dir_index);
            uint32_t begin = begin_of_direntry(entry);
            mapping_t* mapping = find_mapping_for_cluster(s, begin);
+#endif
 
            assert(mapping);
            assert(mapping->begin == begin);
index 46491674fef36f7a6d29581a3be615cc6c9c674e..07616e3b49adbe14502178efdeff05d0ec2fbf01 100644 (file)
@@ -412,7 +412,7 @@ static void QEMU_NORETURN force_sig(int target_sig)
 
     /* unreachable */
     assert(0);
-
+    abort();
 }
 
 /* queue a signal so that it will be send to the virtual CPU as soon
diff --git a/qdict.c b/qdict.c
index 7d1469d40855e07601e619814f10ae96deacefff..7fb425a0cac830197cdf33050caaa6b1ab159c49 100644 (file)
--- a/qdict.c
+++ b/qdict.c
@@ -195,6 +195,7 @@ double qdict_get_double(const QDict *qdict, const char *key)
         return qint_get_int(qobject_to_qint(obj));
     default:
         assert(0);
+        return 0.0;
     }
 }
 
index e6a1caf7958643b8922f40d3b3a4d06f6d2e2762..1818868226833d55fd5e90cb999495d9a723b13e 100644 (file)
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -27,7 +27,7 @@
 
 #include "config.h"
 
-#ifndef CONFIG_DEBUG_TCG
+#if !defined(CONFIG_DEBUG_TCG) && !defined(NDEBUG)
 /* define it to suppress various consistency checks (faster) */
 #define NDEBUG
 #endif