Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On 09/27/2011 01:24 PM, Noel Grandin wrote:
(1) Nice pragma trick for making this problem show up at compile time:
http://stackoverflow.com/questions/74326/how-should-i-detect-unnecessary-include-files-in-a-large-c-project/109890#109890

This would flag double includes that are there for good encapsulation, like when a header contains an inline function definition using rtl::OUString (so header #inlcude "rtl/ustring.hxx"), and that header is included in a cxx that also contains a function definition using rtl::OUString (so cxx too #include "rtl/ustring.hxx").

(2) There is a tool based on clang that can detect unused includes:
http://code.google.com/p/include-what-you-use/

Cool, thanks for the pointer. Always thought about doing something like this, but never came around...

-Stephan

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.