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

What legitimate reasons are there for -I over -iquote? -I is standardized (at least by POSIX) while -iquote isn’t. (Practically, I’m using -I because tinycc (one of the compilers I want my project to compile with) doesn’t support -iquote.)

How do projects manage with -I given the dangers? You’d have the includes wrapped in a directory and use -I to add the directory containing that directory.

  • filesystem: includes/mylib/endian.h
  • command line: -Iincludes
  • C/C++ file: #include "mylib/endian.h" //or <mylib/endian.h>

With that, as long as you don’t clash on the mylib name, you don’t clash (at least as far header names are concerned).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)