BSD didn't even save a size_t by doing this
BSD didn't even save a size_t by doing this
Posted Nov 7, 2024 20:53 UTC (Thu) by khim (subscriber, #9252)In reply to: BSD didn't even save a size_t by doing this by NYKevin
Parent article: The trouble with struct sockaddr's fake flexible array
> I think the more plausible explanation is that somebody didn't feel like writing the extra code to initialize the size field.
The simple explanation is that was 1983. Time where backward compatibility started becoming important but no one really felt it would become critical.
Just five years before that FORTRAN removed some pieces from standard without anyone batting an eye!
Surely it's a software, it's malleable, people would just fix it later, when requirements would change?
It's only when people started dragging feet with upgrade to FORTRAN 77, when people essentially boycotted MS-DOS 4.0 (in 1988!) because it changed some internal data structures which “programs were not supposed to ever touch”, only when OS/2 completely imploded because someone decided to “improve” Presentation Manager API… only then developers of operation systems realized that keeping ABI stable would make or break them (and even after that moment Linux developers denied the obvious for decades, but that's another thing).
I would bet that no one expected to see sockaddr
, casually introduced in 1983 just for the “large-scale experiment” (as Vint Cerf attests IPv4
was envisioned as large-scale experiment, no one expected it to be used outside of academy and there were expectation that another thing or yet another thing would be used by everyone else) – would still be in use 40 years later and would affect hundreds of billions devices… if they have heard about it they would have assumed you have lost all your marbles.