News for hackers. Stuff that matters.
Re:Stop Memsetting Structures by jdblair on Saturday April 27, 2019 @07:26PM (#19768277)
But if you're slamming in-memory structs over the wire, you're using packed structs. You explicitly don't want padding when you use structs that way.

Whether you should do this in 2019 is another question, but sometimes it's still the easiest way to implement a binary protocol.

Re:Stop Memsetting Structures by cardiffspaceman on Saturday April 27, 2019 @09:17PM (#19768696)
And you're not writing code for big-endian machines to interoperate with little-endian machines.

It's easy to write binary protocol code that way but it isn't portable.

Re:Stop Memsetting Structures by jdblair on Sunday April 28, 2019 @04:51PM (#19773608)
It goes without saying that you have get the endian right when you store the values. That's what the endian macros are for.