public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/31186] -I/usr/include not taken into account
       [not found] <bug-31186-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-28  3:45 ` pinskia at gcc dot gnu.org
  2021-08-28 10:37 ` vincent-gcc at vinc17 dot net
  1 sibling, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-28  3:45 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The remaining environment variables apply only when preprocessing the
particular language indicated. Each specifies a list of directories to be
searched as if specified with -isystem, but after any paths given with -isystem
options on the command line.

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. See System Headers.


This part specifically:
 If you really need to change the search order for system directories, use the
-nostdinc and/or -isystem options.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug preprocessor/31186] -I/usr/include not taken into account
       [not found] <bug-31186-4@http.gcc.gnu.org/bugzilla/>
  2021-08-28  3:45 ` [Bug preprocessor/31186] -I/usr/include not taken into account pinskia at gcc dot gnu.org
@ 2021-08-28 10:37 ` vincent-gcc at vinc17 dot net
  1 sibling, 0 replies; 6+ messages in thread
From: vincent-gcc at vinc17 dot net @ 2021-08-28 10:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
OK, so I think there is a bug in the autotools, which use -I instead of
-isystem (unless this has changed).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug preprocessor/31186] -I/usr/include not taken into account
  2007-03-15 14:22 [Bug preprocessor/31186] New: " vincent at vinc17 dot org
                   ` (2 preceding siblings ...)
  2007-05-22 18:11 ` tromey at gcc dot gnu dot org
@ 2007-05-22 21:51 ` vincent at vinc17 dot org
  3 siblings, 0 replies; 6+ messages in thread
From: vincent at vinc17 dot org @ 2007-05-22 21:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from vincent at vinc17 dot org  2007-05-22 22:50 -------
(In reply to comment #3)
> My recollection is that the special -I behavior is there because
> the system headers have special non-warning properties.
> This situation doesn't apply to -L.

But this introduces an inconsistency, with the effect that the version of the
header and the version of the library do not match.

> Generally speaking this is not a good idea.  Usually people *want* their
> environment to influence configure, and usually if configure overrides this
> it means difficult to fix problems on weirder systems.

But configure does override the user's environment for non-system directories
(and even system directories concerning -L). That's not logical.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31186


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug preprocessor/31186] -I/usr/include not taken into account
  2007-03-15 14:22 [Bug preprocessor/31186] New: " vincent at vinc17 dot org
  2007-03-15 15:48 ` [Bug preprocessor/31186] " pinskia at gcc dot gnu dot org
  2007-03-15 16:51 ` vincent at vinc17 dot org
@ 2007-05-22 18:11 ` tromey at gcc dot gnu dot org
  2007-05-22 21:51 ` vincent at vinc17 dot org
  3 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-05-22 18:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tromey at gcc dot gnu dot org  2007-05-22 19:11 -------
My recollection is that the special -I behavior is there because
the system headers have special non-warning properties.
This situation doesn't apply to -L.

> 2. Software is often compiled with configure, make, make install. How can one
> force the compiler to look in /usr/include & /usr/lib first (i.e. override the
> user's environment)?

Generally speaking this is not a good idea.  Usually people *want* their
environment to influence configure, and usually if configure overrides this
it means difficult to fix problems on weirder systems.

I am leaving this open considering that there is still a documentation bug
to be fixed here.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-05-22 19:11:27
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31186


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug preprocessor/31186] -I/usr/include not taken into account
  2007-03-15 14:22 [Bug preprocessor/31186] New: " vincent at vinc17 dot org
  2007-03-15 15:48 ` [Bug preprocessor/31186] " pinskia at gcc dot gnu dot org
@ 2007-03-15 16:51 ` vincent at vinc17 dot org
  2007-05-22 18:11 ` tromey at gcc dot gnu dot org
  2007-05-22 21:51 ` vincent at vinc17 dot org
  3 siblings, 0 replies; 6+ messages in thread
From: vincent at vinc17 dot org @ 2007-03-15 16:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from vincent at vinc17 dot org  2007-03-15 16:51 -------
(In reply to comment #1)
> I don't think this is a bug, you need to read the other part of the document
> which says if you supply -I DEFAULT_DIR, it is ignored.

OK, but this isn't very clear, as the description under -isystem says "*all*
directories specified by -I". I'd replace "all" by "non-ignored". The behavior
w.r.t symbolic links to such directories should also be specified.

Now, this behavior, if it is intentional, leads to 2 questions:

1. Shouldn't -L have a similar behavior to ensure consistency between library
search paths and include search paths?

2. Software is often compiled with configure, make, make install. How can one
force the compiler to look in /usr/include & /usr/lib first (i.e. override the
user's environment)?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31186


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug preprocessor/31186] -I/usr/include not taken into account
  2007-03-15 14:22 [Bug preprocessor/31186] New: " vincent at vinc17 dot org
@ 2007-03-15 15:48 ` pinskia at gcc dot gnu dot org
  2007-03-15 16:51 ` vincent at vinc17 dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-15 15:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-03-15 15:48 -------
I don't think this is a bug, you need to read the other part of the document
which says if you supply -I DEFAULT_DIR, it is ignored.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31186


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-28 10:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-31186-4@http.gcc.gnu.org/bugzilla/>
2021-08-28  3:45 ` [Bug preprocessor/31186] -I/usr/include not taken into account pinskia at gcc dot gnu.org
2021-08-28 10:37 ` vincent-gcc at vinc17 dot net
2007-03-15 14:22 [Bug preprocessor/31186] New: " vincent at vinc17 dot org
2007-03-15 15:48 ` [Bug preprocessor/31186] " pinskia at gcc dot gnu dot org
2007-03-15 16:51 ` vincent at vinc17 dot org
2007-05-22 18:11 ` tromey at gcc dot gnu dot org
2007-05-22 21:51 ` vincent at vinc17 dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).