logoalt Hacker News

bobmcnamaralast Thursday at 10:57 PM2 repliesview on HN

But do we need a unique pointer or merely a pointer that is disjoint from all objects?


Replies

david-gpulast Friday at 8:26 AM

As per the specification, it has to be a unique pointer.

Being tasked to implement a specification typically means having to pass extensive conformance tests and having to answer for instances of noncompliance. You soon learn to follow the spec to the letter, to the best of your abilities, unless you can make a strong case to your management for each specific deviation.

show 2 replies
comexlast Friday at 7:20 PM

Well, sure, standards compliance doesn't matter much on such a small device.

Personally I'd be less worried about uniqueness and more worried about alignment. An address of -1 would violate alignment requirements on most modern targets. But that may have been fine on the target in question; older microcontrollers tended to not have any hardware-level alignment requirements, and the C implementation could have treated all types as having alignment 1.