On 20 Jul 2012, at 17:33, Konstantin Belousov wrote:

> It is not related to dtrace at all, and indeed OFFSETOF_CURTHREAD is 0.
> This is a bug in clang, we compile our kernel in freestanding environment.

The copies of the C spec that I have do not differentiate between freestanding 
and hosted environments for the validity of dereferencing a pointer value of 0. 
 Doing so is undefined in all cases and any standards-compliant compiler is 
quite at liberty to eat your dog in such situations - it is explicitly not 
guaranteed to read the memory at linear address 0 (this is undefined for at 
least two reasons that I can think of from the C spec, and probably more).  

David_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to