c++ - Is there a GCC option for printing headers DIRECTLY included by a source file? -


i want command print headers directly included source file. want print full paths, it's not enough me scan source text include directives , print those. gcc has -h option this; prints indirectly included headers too. don't want digest down information want, because running -h analysis takes time don't want spend, , because there might multiple appearances of 1 filename in different directories in -h output, awkward me automatically handle.

is there command, using gcc or program that's commonly available alongside gcc, given

#include "stuff.h" #include <memory> /* lot more code, no more include directives */ 

in .cpp file, , given normal set of -i options, produce

/opt/stufflib/include/stuff.h /usr/include/c++/5.2.1/memory 

or like—providing me 1 file path per include directive?

if not, guess have duplicate gcc's header file search logic code of own...

since -h gcc preprocessor flag show included files indentation represent how deep #include stack is, can filter output this:

g++ -h --std=c++11 test.cpp 2>&1 | grep "^\.[^\.]" 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -