https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to chuck cranor from comment #3)
> I think you'll find most build systems that do "-isystem /usr/include"
> instead of "-I /usr/include" are only using "-isystem" for the change
> in the warning behavior.  The change in the include path order is not
> wanted...

Then they should stop (mis)using -isystem, since it's clearly documented to
affect the order directories are searched:

  If a standard system include directory, or a directory specified with
  -isystem, is also specified with -I, the -I option is ignored.  The directory
  is still searched but as a system directory at its normal position in the
  system include chain.  This is to ensure that GCC's procedure to fix buggy
  system headers and the ordering for the "#include_next" directive are not
  inadvertently changed.  If you really need to change the search order for
  system directories, use the -nostdinc and/or -isystem options.

The corollary is that you shouldn't use it unless you really need to change the
search order for system directories!

Reply via email to