ARM Memory Tagging is a great example of why it's A Good Thing that pointer arithmetic and relational operators are only defined for operands within a single array.
-
-
But back to your question, for something like struct { int a, b; } c;, the < operator and other relational operators are not defined for operands &c.a and &c.b (&c.a<&c.b is UB). However (char*)&c.a < (char*)&c.b is defined in the representation array.
-
If the char* array representation is the only one doesn't one imply the other? I'm assuming there is only one "physical" block of memory defined as the structure.
-
It's just a matter of how the < operator is defined. It's only defined for elements of the same array. There is an overlaid representation array of unsigned char [2*sizeof(int)]. There is not an overlaid array int[2].
-
huh, i have tons more questions but they'll never end so i might as well find a book.
-
Hah, good luck finding a book on C that's not all misinformation. ;-)
-
I'm assuming it'll have to be the spec
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.