Skip to contentSkip to conversation

mini-os: warnings when compiling with -O

PATCH New Dietmar Hahn 1 participant 1 message Jan 19, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mini-os: warnings when compiling with -O

Hi,

I tried compiling mini-os with optimization flag switched on and got some warnings leading to errors because of the -Werror flag.
The stuff in netfront.c seems to be forgotten to remove during the update of the orginal patch from Jacob. Maybe it's better to remove it. Thanks.

Dietmar.

# HG changeset patch
# User [email protected]
# Date 1169202107 -3600
# Node ID e9c7d2ed782fca937aa15131d42e69cbca32db02 # Parent e2539ab3580a28a6bebfe7ea4756fb8c6f90a722 Fixed warnings when compiling with -O.

extras/mini-os/arch/x86/mm.c +1 -0
diff -r e2539ab3580a -r e9c7d2ed782f extras/mini-os/arch/x86/mm.c
@@ -61,6 +61,7 @@ void new_pt_frame(unsigned long *pt_pfn,
     mmu_update_t mmu_updates[1];
     struct mmuext_op pin_request;
     
+    prot_e = prot_t = pincmd = 0;
     DEBUG("Allocating new L%d pt frame for pt_pfn=%lx, "
            "prev_l_mfn=%lx, offset=%lx", 
            level, *pt_pfn, prev_l_mfn, offset);
extras/mini-os/netfront.c +2 -2
diff -r e2539ab3580a -r e9c7d2ed782f extras/mini-os/netfront.c
@@ -327,7 +327,7 @@ done:
     printk("backend at %s\n",backend);
     printk("mac is %s\n",mac);
 
-    char *res;
+    // char *res;
     char path[256];
     sprintf(path,"%s/state",backend);
 
@@ -336,7 +336,7 @@ done:
     xenbus_wait_for_value(path,"4");
 
     //free(backend);
-    free(res);
+    // free(res);
 
     printk("**************************\n");
 
extras/mini-os/xenbus/xenbus.c +1 -1
diff -r e2539ab3580a -r e9c7d2ed782f extras/mini-os/xenbus/xenbus.c
@@ -103,7 +103,7 @@ static void xenbus_thread_func(void *ign
 static void xenbus_thread_func(void *ign)
 {
     struct xsd_sockmsg msg;
-    unsigned prod;
+    unsigned prod=0;
 
     for (;;) 
     {