Re: How to identify unnecessary include header files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2025-08-10 at 23:38 +0530, Rajeev Bansal via Gcc-help wrote:
> Hello,
> 
> I am working on a large C/C++ project compiled with GCC and am looking for
> ways to identify unnecessary header files. I'm wondering if there's a tool
> similar to `include-what-you-use` (IWYU) that can help with this
> information in gcc.
> 
> Any advice or recommendations would be greatly appreciated.

In addition of the previous reply, don't forget link time optimization and precompiled headers in GCC. Sometimes both are improving things.

Observe that even the optimization level is known (and used) in some Linux system header files.
(so your goal depend upon the compilation options)

Regards.
-- 
Basile STARYNKEVITCH                            <basile@xxxxxxxxxxxxxxxxx>
8 rue de la Faïencerie                       http://starynkevitch.net/Basile/  
92340 Bourg-la-Reine                         https://github.com/bstarynk
France                                https://github.com/RefPerSys/RefPerSys




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux