Why do projects use the -I include switch given the dangers?

后端 未结 4 905
独厮守ぢ
独厮守ぢ 2021-02-01 15:20

Reading the fine print of the -I switch in GCC, I\'m rather shocked to find that using it on the command line overrides system includes. From the preprocessor docs

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-01 15:40

    I this your premise that it's -I that's dangerous is false. The language leaves the search for header files with either form of #include sufficiently implementation-defined that it's unsafe to use header files that conflict with the names of the standard header files at all. Simply refrain from doing this.

提交回复
热议问题