Hacker News new | ask | show | jobs
by johanbcn 937 days ago
Libraries shouldn't be reading environment variables, that responsibility should be only for the application.
2 comments

They shouldn't, but if even the C standard library reads environment variables, then the bar is set pretty low for library designers.

Look up the mess around LOCALE sometime.

The best the programmer can do is perform all the setenv calls before spawning any threads or making any library calls.

It is common, out of my head SDL and pipewire do it.