Why does -nostdinc also remove builtin headers?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Why does -nostdinc also remove builtin headers?

Tom Stellard via cfe-dev
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

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Why does -nostdinc also remove builtin headers?

Tom Stellard via cfe-dev
On Thu, Sep 05, 2019 at 05:21:45PM -0400, Louis Dionne via cfe-dev wrote:
> 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.

The option has been around like that for a long time and quite a bit of
code depends on it. The separation between "builtin" headers and
"system" headers is also quite platform specific, e.g. often
non-existing on the BSDs.

Joerg
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev