Possible Duplicates:
C/C++: Detecting superfluous #includes?
How should I detect unnecessary #include files in a large C++ project?
I'm looking to do some house cleaning in our code base. I would like to start by removing all unnecessary header includes from our source files (*.c and *.cpp). Does anyone know of a tool or technique for doing this?
We are using GCC on Mac, Linux and Solaris. Using Visual Studio on Windows. I looked through the documentation of both compilers and there did not seem to be a option to make it warn for unnecessary includes.
Any thoughts or advice are appreciated.