about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-04-08 00:41:24 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2011-04-08 00:41:52 +0200
commit973023030e7c0ca9814bc60f389bb8d75923edc7 (patch)
treec4e4b24902b899a1f9815ca30edaaf0d6a2f8915 /src
parent21b31a350a78374de951ae72d1223d3bd4894301 (diff)
add -O2 when compiling rt, fix warnings triggered by optimizer
Diffstat (limited to 'src')
-rw-r--r--src/rt/rust_crate_reader.cpp4
-rw-r--r--src/rt/rust_internal.h2
-rw-r--r--src/rt/rust_task.cpp4
-rw-r--r--src/rt/util/indexed_list.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/rt/rust_crate_reader.cpp b/src/rt/rust_crate_reader.cpp
index edad0c2eeee..00253a68f77 100644
--- a/src/rt/rust_crate_reader.cpp
+++ b/src/rt/rust_crate_reader.cpp
@@ -65,7 +65,7 @@ rust_crate_reader::mem_reader::adv_zstr(size_t sz)
 {
   sz = 0;
   while (ok) {
-    char c;
+    char c = 0;
     get(c);
     ++sz;
     if (c == '\0')
@@ -124,7 +124,7 @@ rust_crate_reader::abbrev_reader::abbrev_reader
     //          tell_off());
 
     uintptr_t idx, tag;
-    uint8_t has_children;
+    uint8_t has_children = 0;
     get_uleb(idx);
     get_uleb(tag);
     get(has_children);
diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h
index a1cc8e514b0..4a1f3e458b3 100644
--- a/src/rt/rust_internal.h
+++ b/src/rt/rust_internal.h
@@ -403,7 +403,7 @@ rust_crate_reader
         void get_uleb(T &out) {
             out = T(0);
             for (size_t i = 0; i < sizeof(T) && ok; ++i) {
-                uint8_t byte;
+                uint8_t byte = 0;
                 get(byte);
                 out <<= 7;
                 out |= byte & 0x7f;
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 4f7bbda61c6..c2fefef0d99 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -175,7 +175,7 @@ rust_task::start(uintptr_t exit_task_glue,
     *spp-- = (uintptr_t) 0x0;        // output
     *spp-- = (uintptr_t) 0x0;        // retpc
 
-    uintptr_t exit_task_frame_base;
+    uintptr_t exit_task_frame_base = 0;
 
     if (spawnee_abi == ABI_X86_RUSTBOOT_CDECL) {
         for (size_t j = 0; j < n_callee_saves; ++j) {
@@ -454,7 +454,7 @@ rust_task::notify_tasks_waiting_to_join() {
     while (tasks_waiting_to_join.is_empty() == false) {
         log(rust_log::TASK, "notify_tasks_waiting_to_join: %d",
             tasks_waiting_to_join.size());
-        maybe_proxy<rust_task> *waiting_task;
+        maybe_proxy<rust_task> *waiting_task = 0;
         tasks_waiting_to_join.pop(&waiting_task);
         if (waiting_task->is_proxy()) {
             notify_message::send(notify_message::WAKEUP, "wakeup",
diff --git a/src/rt/util/indexed_list.h b/src/rt/util/indexed_list.h
index df887122801..173e9ede2ba 100644
--- a/src/rt/util/indexed_list.h
+++ b/src/rt/util/indexed_list.h
@@ -59,7 +59,7 @@ indexed_list<T>::remove(T *value) {
     assert (value->list_index >= 0);
     assert (value->list_index < (int32_t)list.size());
     int32_t removeIndex = value->list_index;
-    T *last;
+    T *last = 0;
     list.pop(&last);
     if (last->list_index == removeIndex) {
         last->list_index = -1;