Opened 9 years ago

Closed 5 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:
Has a Patch: no Platform: All

Description

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 Changed 8 years ago by Disreali

what does that mean?

comment:2 Changed 8 years ago by phoudoin

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

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

comment:3 Changed 8 years ago by Disreali

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 Changed 5 years ago by waddlesplash

Resolution: fixed
Status: newclosed

Clang support has been merged to master.

Note: See TracTickets for help on using tickets.