fabic974 random (binary) wanderings in the philament empires…

Clang/GCC: find out default include path

This will list the hard-coded compiler include paths :

clang++ -Wp,-v -x c++ - -fsyntax-only < /dev/null

Or :

clang++ -E -x c++ - -v < /dev/null

Using Sed to select those include path (SO):

$ clang++ -Wp,-v -x c++ - -fsyntax-only < /dev/null 2>&1 |
    sed -e '/^#include <...>/,/^End of search/{ //!b };d'

Where //!b :

@Brendan the instruction //!b reads if the current line is neither one of the lines that match the range, break and therefore print those lines otherwise all other lines are deleted. – potong Feb 17 ‘17 at 1:14

EOF