On Wed, Mar 05, 2025 at 10:54:01AM +1100, Rob Pike wrote:
The notion that the struct layout must correspond to
the hardware device's
layout is about as non-portable as thinking can get.
I agree but as a side note, I ported Lachman's (nee Convergent I believe)
TCP/IP stack to ETA-10's Sys V OS and to SCO's v7 or whatever they had.
Somewhere I have a note book where I laid out in structs every packet
format with notes about what that packet did, I was learning.
Not once did I think about packing, the structs somehow just worked on
the machines I was working on. Maybe the TCP/IP guys knew about spacing
in the structs.
I get it, I was naive, but sometimes the structs work.