prevent gcc from searching the current dir “-I-” option on include search path

前端 未结 1 391
臣服心动
臣服心动 2021-01-11 17:33

Our dev environment makes heavy use of directories with locally modified headers that should be seen by the compiler instead of the \"committed\" \"repository\" versions.

相关标签:
1条回答
  • 2021-01-11 18:17

    AFAIK, there is no other way to desactivate the behaviour you are complaining about other than using the form #include <foo.h> instead of #include "foo.h" in your code.

    ISTR, but I've failed to find a reference, that the rationale for deprecating -I- without providing another mechanism for that aspect is that libraries commonly use the form #include "foo.h" to ensure they get their own internal header file foo.h and the use of -I- broke them in some cases if someone else happened to have a file similarly named earlier on the search path.

    0 讨论(0)
提交回复
热议问题