this is my struct :
struct Node {
struct Node* data;
struct Node* links[4];
}
assuming there is no padding, does Node->links[-1] guaranteed to be pointing on Node::data ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No guarantee; this is undefined behaviour:
Possible strict-aliasing violationIn practice, it’s quite possible that you will end up pointing at
data, but any attempts to access it will result in UB.