Open GoogleCodeExporter opened 9 years ago
IWYU only analyzes compilation-unit-at-a-time; a .c/.cpp file and its
associated header file. If it analyzed and made changes to *all* headers it
wouldn't work with parallellizing build systems. But it can only associate
header and source file if they have the same basename.
So for example4, if I rename hello_world_header_missing_header.c to
hello_world.c and hello_world1.h to hello_world.h (and fixing up include lines)
they will be recognized as a unit, and IWYU will actually suggest that
hello_world.h should include hello_world2.h
And the same thing goes for example5 -- by renaming the .c file and the
hello_world1.h header to hello_world.*, IWYU will understand that they should
be analyzed together and suggest that .c removes the include of hello_world2.h
You can express this explicitly as well with the --check_also switch:
$ include-what-you-use.exe -Xiwyu --check_also=hello_world1.h
hello_world_header_missing_header.c
Original comment by kim.gras...@gmail.com
on 14 May 2015 at 8:47
Thanks. It is very useful for me. Maybe such important info should be added to
the page
https://code.google.com/p/include-what-you-use/wiki/InstructionsForUsers
Original comment by zhanglii...@gmail.com
on 15 May 2015 at 6:18
Original issue reported on code.google.com by
zhanglii...@gmail.com
on 14 May 2015 at 3:24Attachments: