Ask Your Question
0

how to identify excess includes

asked 2015-07-08 12:16:24 -0600

albertJ gravatar image

updated 2015-07-08 12:18:04 -0600

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-07-09 01:02:13 -0600

themightyoarfish gravatar image

updated 2015-07-09 01:02:35 -0600

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-07-08 12:16:24 -0600

Seen: 228 times

Last updated: Jul 09 '15