[cfe-dev] Why does -nostdinc also remove builtin headers?

Louis Dionne via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 5 14:21:45 PDT 2019


Hi,

When passing -nostdinc to Clang, the builtin header search path is also removed. I find that surprising, since -nobuiltininc also removes the builtin header search path. I would find the following more natural:

  -nostdinc removes the standard C system headers, but not the builtin headers
  -nobuiltininc removes the builtin headers, but nothing else
  -nostdinc++ removes the standard C++ system headers, and nothing else

Is there a rationale for the current behavior? Is this the kind of thing that we could change, or would that absolutely require introducing a new flag for fear of breaking users?

Thanks,
Louis




More information about the cfe-dev mailing list