3 ms·
You don't even need to pun that. It's legal to say: struct myStruct example; read(fd, &example, sizeof(example)); That "should present no problem unle
by jart 6y ago
You don't even need to pun that. It's legal to say:
struct myStruct example;
read(fd, &example, sizeof(example));
That "should present no problem unless binary data written by one implementation are read by another" quoth ANSI X3.159-1988. One example of a time where I've used that, is when storing intermediary build artifacts. Those artifacts only exist on the host machine. If the binary that writes/reads those artifacts gets recompiled, then the Makefile will invalidate the artifacts so they're regenerated. Since flags like -mstructure-size-boundary=n do exist and ABI breakages have happened with structs in the past.