https://issues.dlang.org/show_bug.cgi?id=23040
Issue ID: 23040 Summary: importC: optimizer rejects null dereference of volatile pointer Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: ImportC, rejects-valid Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: du...@neet.fi CC: du...@neet.fi void my_fatal() { *((volatile unsigned int *) 0) = (unsigned int) 0xdeadbeefUL; } compile: dmd -O -c test.c Error: null dereference in function my_fatal i see in https://github.com/dlang/dmd/blob/b1ac484/src/dmd/backend/cgelem.d#L6253 where the error is emitted, it has a check to allow this with volatile pointers but the keyword is ignored in importC --