I can see practical use for a const volatile
qualified variable, like
const volatile uint64_t seconds_since_1970;
if an underlying hardware mechanism updates the value every second, but the variable is not writable in the (possibly embedded) hardware.
And since all three (four in C11) type qualifiers are considered independent, all combinations do seem to be allowed. But I'm at a loss imagining a real-life situation where a restrict volatile
qualified pointer would really make sense:
uint32_t * restrict volatile pointer_to_some_uint32;
[EDIT: To clarify: Both volatile
and restrict
apply to the pointer, not to the object pointed to!]
Is this a construct allowed by the language but useless by itself, or am I missing some application area where this can be valuable?
const
volatile
restrict
......Could you tell me what is the fourth qualifier? Sorry for my little knowledge >o< – Abed_Atomic
. – Exobiology