'If XInitThreads() is not called anywhere in a multi-tasked program, the program will usually work. But weird crashes and other race conditions are bound to happen over time, as Xlib maintains some global data that is shared across all threads and all "displays".'
Is there a reason you can't catch this with static analysis tests? Also, I don't really see this as an issue with xlib any more than I see it as an issue with a careless developer who didn't read documentation or check or examples.