Fix userprog tests for clang
[pintos-anon] / src / tests / userprog / bad-jump.c
index 51b7c9f57ea6a15cfe60a254a7fb3cd04fae87ea..a915c396b874e5338daecf0cd3f4d6aa1150deee 100644 (file)
@@ -4,10 +4,13 @@
 #include "tests/lib.h"
 #include "tests/main.h"
 
+typedef int (* volatile functionptr)(void);
+
 void
 test_main (void) 
 {
+  functionptr fp = NULL;
   msg ("Congratulations - you have successfully called NULL: %d", 
-        ((int (*)(void))NULL)());
+        fp());
   fail ("should have exited with -1");
 }