5 ms·
Can't you use precompiled headers?
by daymanstep 2y ago
Can't you use precompiled headers?
- WalterBright 2y agoInteresting you brought that up. I implemented them for Symantec C and C++ back in the 90s. I never want to do that again! They are brittle and a maintenance nightmare. They did speed up compilations, though, but did not provide any semantic advantage. With D I focused on fast compilation so much that precompiled headers didn't offer enough speedup to make them worth the agony.
- fuhsnn 2y ago>They are brittle and a maintenance nightmare I happened to be reading DMC source this week, those hydrate/dehydrate stuff really is everywhere (which I assume is solely used for precompiled headers?)
- WalterBright 2y agoYup. I spent a crazy amount of time debugging that. The tiniest mistake was a big problem to find.
- ndesaulniers 2y agoI had an intern try to use precompiled headers for the Linux kernel. The road block they found was that the command line parameters used to compile the header must exactly match for all translation units which it is used. This is no the case for the Linux kernel. We could compile the header multiple times, but the build complexity was not something we could overcome during the course of one internship.
- WalterBright 2y ago> must exactly match Yup. My compiler kept a list of which switches would perturb compilation and so would invalidate the precompiled header, and which did not. Precompiled headers are an awful, desperate feature. Good riddance.