
Microsoft Visual C++ is just one of many important components that the operating system requires, when running certain programs on your system. Rather that declaring things which cause build failures apply here as well.Microsoft’s operating systems is essentially a combination of applications that work together to provide various functionalities for the end user. The caveats mentioned in other answers about headers that modify behavior Requires it, which probably isn't what you meant. h is almost certainly a bug: you are in effect promising that yourĬode will only require that header as long as some other header you're using Note that depending on indirect inclusion when your. Included indirectly, so the include was correct to begin with. You still don't know if string.h is required. string.h wasn't compile-critical, and the include for it Of course your interface headers might use a different #define convention String.h), you can comment out that include then put this below all the If there's a particular header that you think isn't needed anymore (say


By checking how a class is used though a specific path of files, it is possible that the definition of the class (and therefore all of its dependnecies) can be removed completely or at least moved to a level closer to the main source in the include tree. (See: Visibility of template specialization of C++ function)Īs pointed out by 'msalters', performing a full analysis of the code also allows for analysis of class usage. Removing the header with the specialization will not cause a compile error, but may result in undefined behaviour if that specialization would have been selected.

It might be that specializations for the primary template are in different header files. Similar to the overload example, if you have partial or explicit specializations for a template you want them all to be visible when the template is used. It might be that removing one header file results in a different overload being chosen rather than a compile error! The result will be a silent change in semantics that may be very difficult to track down afterwards. It's possible that an overloaded function has declarations that come from different files. There are several issues with a simple non parsing approach:

!!DISCLAIMER!! I work on a commercial static analysis tool (not PC Lint).
