News for hackers. Stuff that matters.
Re:Sshole by cowlevel on Friday November 06, 2026 @12:09AM (#50388453)
Historically it didn't work well between different compilers. Maybe it still doesn't.
Re:Sshole by chuckadams on Friday November 06, 2026 @09:35AM (#50392793)
Passing and returning structs by value has been part of C since C89. Most compilers pass small structs in individual registers, and nowadays with LTO they'll even elide the copy of bigger ones if they can. What's definitely the case though is that by-value structs weren't a common thing when most of the Unix API was written.
Re:Sshole by kps on Friday November 06, 2026 @10:49AM (#50393843)
Structure assignment, passing, and returning were added in UNIX V7 C.