some hardware registers are read only, some registers are write only. usually, register are mapped to certian memory address and accessed as pointers. if you read a write only register may generate unspecified behavior.
of course, you can use _writeOnly to decorat the name, but you are still rely on programmer to follow it. if programmer make mistake or just want to sabotage it, it is hard to find it. If language give you this kind of capability, the compiler will fail at compile time and report this is a bug.
I couldn't find a way to implement this feature using C.
of course, you can use _writeOnly to decorat the name, but you are still rely on programmer to follow it. if programmer make mistake or just want to sabotage it, it is hard to find it. If language give you this kind of capability, the compiler will fail at compile time and report this is a bug.
I couldn't find a way to implement this feature using C.