News for hackers. Stuff that matters.
Re:1.5 is the midpoint between 0 and infinity in Ruby by haberman on Friday November 27, 2020 @03:58PM (#25232516)
memcpy() by itself cannot violate aliasing rules. By definition, char can alias any object.

Whether you can access an object that has been memcpy()'d into is a separate question. I can't find specific language about this, but I strongly suspect that the result is implementation-defined or unspecified (not undefined), unless there is a possibility of a trap representation.

Re:1.5 is the midpoint between 0 and infinity in Ruby by kazinator on Friday November 27, 2020 @05:20PM (#25233074)
This remark doesn't appear to add anything to my original unedited comment, which includes the clarifying words "you can't memcpy an object to one of a different type and then access it as that type without invoking undefined behavior".