Results 1 to 6 of 6

Thread: A tool to remove unused header files?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A tool to remove unused header files?

    I assure you that you daily use a lot of headers such as these.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: A tool to remove unused header files?

    Sadly, I wouldn't be at all surprised if you were right and, in that context, I appreciate your original comment.

    Otherwise, someone pointed me to https://code.google.com/p/include-what-you-use/. I wonder how that (beta) tool would handle your example...

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A tool to remove unused header files?

    No idea. However no tool will be able to detect that both files are needed as when a.h is present then b.h is not needed but once you remove a.h (or better yet have an ifndef there as well) b.h (or equivalent) is required despite the fact it is not used originally. It becomes even more complex with:

    Qt Code:
    1. #ifdef Q_OS_UNIX
    2. #include "a.h"
    3. #endif
    4. #include "b.h"
    To copy to clipboard, switch view to plain text mode 

    I'm sure I can find myrriads of other examples when such automatic cleanup would fail. Sorry but no tool can replace the process of thinking about what one's doing.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Header Files
    By Maluko_Da_Tola in forum Newbie
    Replies: 1
    Last Post: 2nd October 2010, 12:04
  2. Replies: 2
    Last Post: 30th September 2010, 12:26
  3. Remove unused points from a QPainterPath
    By JaV0 in forum Qt Programming
    Replies: 0
    Last Post: 4th March 2010, 08:35
  4. How to add a tool button to a qlistview header
    By kalos80 in forum Qt Programming
    Replies: 2
    Last Post: 31st July 2008, 10:13
  5. header files not getting included
    By nimmyj in forum Installation and Deployment
    Replies: 1
    Last Post: 19th December 2006, 06:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.