On Sun, 24 Jul 2022, 13:41 aiishymanel--- via Gcc-help, < gcc-help@xxxxxxxxxxx> wrote: > Hi everyone, > > the documentation explicitly states that empty elements in CPATH and other > variables that control header search path can appear at thebeginning or end > of a list. > > https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html > > But in reality nothing stops you from putting empty element anywhere in > the list. > I think the idea is that it's obvious that "::" in the middle is an empty path, but it's saying that it can also appear at the ends, like ":foo". > export CPATH="$HOME/include::$HOME/project/include" > > cpp -nostdinc /dev/null -o /dev/null -v 2>&1 | awk '/#include/,/End/' > > #include "..." search starts here: > #include <...> search starts here: > /root/include > . > /root/project/include > End of search list. > > In general I would not consider it to be a bug, but the accent on the > beginning and end of the list makes me wonder it it is a bug or a bad > description. > I suppose it could say empty elements can appear anywhere, including the beginning or end. > Thanks, > Andrii >