DeVault: Announcing the Hare programming language
DeVault: Announcing the Hare programming language
Posted May 10, 2022 23:48 UTC (Tue) by nybble41 (subscriber, #55106)In reply to: DeVault: Announcing the Hare programming language by farnz
Parent article: DeVault: Announcing the Hare programming language
> If an attempt is made to refer to an object defined with a volatile-qualified type through use of an lvalue with non-volatile-qualified type, the behavior is undefined.[57]
> [57] This applies to those objects that behave as if they were defined with qualified types, even if they are never actually defined as objects in the program (such as an object at a memory-mapped input/output address).
Objects in the page at pte->v_addr behave as if they were defined as volatile objects because the content changes in ways not described by the C abstract machine when pte->p_addr is updated. The same applies to passing a pointer to volatile object(s) to memset(), which takes a non-volatile pointer.
The initializer for page_location (pte->v_addr) is also not a constant, but I assume this is just pseudo-code for the value being set by some initialization function not shown here.
