Fix userprog tests for clang
[pintos-anon] / src / tests / userprog / no-vm / multi-oom.c
index 6a4472daed7575a319e0ee57cdf26836af34f5bd..cd2c939e808aaac822de41c7779530f64045d027 100644 (file)
@@ -67,15 +67,15 @@ consume_some_resources_and_die (int seed)
 {
   consume_some_resources ();
   random_init (seed);
-  int *PHYS_BASE = (int *)0xC0000000;
+  volatile int *PHYS_BASE = (volatile int *)0xC0000000;
 
   switch (random_ulong () % 5)
     {
       case 0:
-        *(int *) NULL = 42;
+        *(volatile int *) NULL = 42;
 
       case 1:
-        return *(int *) NULL;
+        return *(volatile int *) NULL;
 
       case 2:
         return *PHYS_BASE;