News for hackers. Stuff that matters.
Re:C stdlib isn't threadsafe and even safe Rust didn't save us by hinkley on Thursday January 23, 2025 @01:44PM (#42806719)
Not “everyone” does that. You have individual files doing their own initialization when they get loaded. Including loading other files or modules.

They might do it for testing purposes.

Re:C stdlib isn't threadsafe and even safe Rust didn't save us by bluGill on Thursday January 23, 2025 @06:17PM (#42809058)
That does happen. Still there is a reason many avoid it. Probably every significant project has places where they do that. Still if it isn't in main it is always a little "magic" and that means hard to understand how the program works. (or worse randomly doesn't work because something is used before it is initialized)