Ask Your Question
0

how to identify excess includes

asked Jul 8 '15

albertJ gravatar image

updated Jul 8 '15

I'm working on a relatively large piece of filterbank code and have managed to amass a large collection of headers many of which were for code which is no longer in the project.

Is there any way or method outside of just trial and error to identify which ones are actually being used so i can speed up compilation? Also would just help to make the code a bit leaner.

Thanks in advance! Albert

Edit: i'm using atom 1.0.0 in case there are any good packages or snippets

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered Jul 9 '15

themightyoarfish gravatar image

updated Jul 9 '15

Does your IDE or editor of choice not show errors when it cannot find a header? If it does, why not just delete the suspects and check whether it still compiles?

You could run a command on the command line, prepending #warning "I am being included" or some such thing to every header, although that seems not so straightforward, so you might be better off inserting that line by hand. The #warning directive prints something when the header is processed, so you should see al those messages belonging to included headers.

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Jul 8 '15

Seen: 245 times

Last updated: Jul 09 '15