3 ms·
Even with a monorepo this isn't necessarily safe -- if you have a mix of x86 and arm servers, you'll need different headers included for intrinsics for example.
by cperciva 6y ago
Even with a monorepo this isn't necessarily safe -- if you have a mix of x86 and arm servers, you'll need different headers included for intrinsics for example.
- quantumofalpha 6y agoConditionally-off blocks of code under #ifdefs are challenging for it, yes - it runs a proper C++ compiler on your code and won't get to see code in those blocks without the right defines. Don't blindly apply its suggestions - test them, skim to see what it got wrong, sprinkle some "// IWYU pragma: keep" to help it out in corner cases. The tool is more like a linter, you don't follow everything that your linter tells you to, no?
- kccqzy 6y agoThe fix then is simple: run IWYU twice, the first time targeting x86 and then targeting arm. Then you merge the results of these two runs. For conflicts, just don't remove anything. FWIW: when I run this tool my experience tends to be that it adds more includes than it removes, because I guess I rely too much on transitive includes.