Subject: Re: [std-proposals] Allowing access to object representations
From: Jake Arkinstall (jake.arkinstall_at_[hidden])
Date: 2019-08-24 04:55:25
I see (or at least I think I do).
In which case, the standard is not just badly worded, it is completely
unimplementable. Once it is reinterpret casted to a char pointer and passed
to a function that treats it as a char pointer (particularly a function
that is already compiled and has no knowledge of the context), it's going
to use the leftmost byte. Unless it's at the reinterpret cast where it's
decided that the char pointer has a different address to the int pointer.
I'm not sure. Standardese is confusing at the best of times, let alone when
it contradicts fundamentals (and a total of millions of lines worth of
perfectly working low level code). If the idea is to make C more
attractive, it's working.
The idea that the binary is the representation and "the object" is
fundamental is at odds with reality. The compilation process, for example,
treats the object as the representation and the binary as fundamental.
On Thu, 22 Aug 2019, 13:35 sdkrystian via Std-Proposals, <
> Jake, you're thinking about it the wrong way. There exists no char object
> to bind to. None. The standard does not provide any way for you to do so.
> What language-lawyer and I have been writing are directly what the standard
> says. The standard says nothing about it binding to the first byte or any
> nonsense like that, it explicitly states that it will still point to the
> original object, no question about it, and the indirection operator will
> unambiguously yield the original object.
> It does not matter what cppreference says, this is what the standard says.
> It might not be intended, but this is currently how it works.
> Sent from my Samsung Galaxy smartphone.
> Std-Proposals mailing list
STD-PROPOSALS list run by herb.sutter at gmail.com
Standard Proposals Archives on Google Groups