Opened 11 years ago

Closed 7 years ago

#6791 closed bug (fixed)

Missing volatile keyword

Reported by: kaliber Owned by: axeld
Priority: normal Milestone: R1
Component: System/Kernel Version: R1/Development
Keywords: Cc: mdisreali@…
Blocked By: Blocking:
Platform: All


Clang says:

src/system/kernel/arch/x86/vm86.cpp:573:2: error: indirection of non-volatile null pointer will be deleted, not trap
        *((uint32 *)0) = 0xdeadbeef;
src/system/kernel/arch/x86/vm86.cpp:573:2: note: consider using __builtin_trap() or qualifying pointer with 'volatile'

Change History (4)

comment:1 by Disreali, 10 years ago

what does that mean?

comment:2 by phoudoin, 10 years ago

I guess clang will be happier if it was written as follow:

*((volatile uint32 *)0) = 0xdeadbeef;

comment:3 by Disreali, 10 years ago

Cc: mdisreali@… added

That is how it is currently written. see here

I just watched the "libclang: Thinking Beyond the Compiler" video and if I understand correctly, the error is the underlined *((uint32 *)0) part, . Clang is suggesting a replacement:

 note: consider using __builtin_trap() or qualifying pointer with 'volatile'

However, I have no real idea what the 0xdeadbeef is all about, so take with a grain of salt.

comment:4 by waddlesplash, 7 years ago

Resolution: fixed
Status: newclosed

Clang support has been merged to master.

Note: See TracTickets for help on using tickets.