News for hackers. Stuff that matters.
Re:Stop Memsetting Structures by CJefferson on Saturday April 27, 2019 @03:44PM (#19767277)
Changing compiler or flags won't change structs, unless you do something crazy. If it did, you couldn't link C libraries compiled with one compiler with programs compiled on another.

You can't be sure you can send such structures to different OSes or CPUs however.

Re:Stop Memsetting Structures by saagarjha on Saturday April 27, 2019 @10:58PM (#19769037)
> If it did, you couldn't link C libraries compiled with one compiler with programs compiled on another.

You cannot do this unless the compilers have the same ABI, which is not part of the standard.

Re:Stop Memsetting Structures by spc476 on Saturday April 27, 2019 @04:56PM (#19767579)
It depends upon the architecture and compiler. One C compiler for the MC68000 might have int as 16 bits (since externally, the MC68000 had a 16-bit external bus) but another one have ints as 32 bits (since the MC68000 can handle 32-bits internally). This was more of an issue during the 80s and 90s when you had more commercial C compiler available than today.
Re:Stop Memsetting Structures by Gibbon1 on Saturday April 27, 2019 @06:52PM (#19768124)
That is what stdint is for.