Commit 6ce8d8ab authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Cyrill Gorcunov

Make BUG_ON() clang-compatible

When trying to compile the beast with clang, it complains:

====
./include/lock.h:33:2: error: indirection of non-volatile null pointer will be deleted, not trap
        BUG_ON(ret < 0);
        ^~~~~~~~~~~~~~~
In file included from restorer.c:18:
./include/util.h:118:27: note: instantiated from:
#define BUG_ON(condition)       BUG_ON_HANDLER((condition))
                                ^
./include/util.h:100:4: note: instantiated from:
                        *(unsigned long *)NULL = 0xdead0000 + __LINE__; \
                        ^
====

Make clang happy again by adding 'volatile'.
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 0b237ae9
......@@ -96,7 +96,7 @@ extern void printk(const char *format, ...);
write_string("BUG at " __FILE__ ": "); \
write_num(__LINE__); \
write_string("\n"); \
*(unsigned long *)NULL = 0xdead0000 + __LINE__; \
*(volatile unsigned long *)NULL = 0xdead0000 + __LINE__; \
} \
} while (0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment