public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* a question about one part of gcc manual
@ 2011-04-24 15:06 ali hagigat
  2011-04-25  6:37 ` David Kirkby
  0 siblings, 1 reply; 14+ messages in thread
From: ali hagigat @ 2011-04-24 15:06 UTC (permalink / raw)
  To: gcc-help

3.14 options for directory search
"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.  "

I do not understand this part the gcc manual. What is GCC procedure?
How buggy system headers will be fixed? and what ordering is talking
about? What is include-next the manual is talking about? I wonder if
anybody can study this part and say that in other words.

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

* Re: a question about one part of gcc manual
  2011-04-24 15:06 a question about one part of gcc manual ali hagigat
@ 2011-04-25  6:37 ` David Kirkby
  2011-04-25 18:01   ` Ian Lance Taylor
  0 siblings, 1 reply; 14+ messages in thread
From: David Kirkby @ 2011-04-25  6:37 UTC (permalink / raw)
  To: ali hagigat; +Cc: gcc-help

On 24 April 2011 13:00, ali hagigat <hagigatali@gmail.com> wrote:
> 3.14 options for directory search
> "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.  "
>
> I do not understand this part the gcc manual. What is GCC procedure?
> How buggy system headers will be fixed? and what ordering is talking
> about? What is include-next the manual is talking about? I wonder if
> anybody can study this part and say that in other words.

I guess this is a reference the the "fixincludes"

http://www.gnu.org/software/autogen/fixinc.html

which gcc uses to "fix" header files it does not like. In practice,
I've found the gcc solution to be far from optimal.

I note that the Clang compiler has rejected the fixincludes approach
used by gcc.

Dave

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

* Re: a question about one part of gcc manual
  2011-04-25  6:37 ` David Kirkby
@ 2011-04-25 18:01   ` Ian Lance Taylor
  2011-04-26  6:24     ` ali hagigat
  0 siblings, 1 reply; 14+ messages in thread
From: Ian Lance Taylor @ 2011-04-25 18:01 UTC (permalink / raw)
  To: David Kirkby; +Cc: ali hagigat, gcc-help

David Kirkby <david.kirkby@onetel.net> writes:

> I note that the Clang compiler has rejected the fixincludes approach
> used by gcc.

What do they do instead?

Ian

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

* Re: a question about one part of gcc manual
  2011-04-25 18:01   ` Ian Lance Taylor
@ 2011-04-26  6:24     ` ali hagigat
  2011-04-26  7:08       ` Ian Lance Taylor
  2011-04-26 11:07       ` ali hagigat
  0 siblings, 2 replies; 14+ messages in thread
From: ali hagigat @ 2011-04-26  6:24 UTC (permalink / raw)
  To: Ian Lance Taylor, gcc-help, david.kirkby

When fixincludes is executed? Is it executed when installing gcc ONLY?
What is "include_next" directive in the section of 3.14 of gcc manual?


On Mon, Apr 25, 2011 at 10:22 PM, Ian Lance Taylor <iant@google.com> wrote:
> David Kirkby <david.kirkby@onetel.net> writes:
>
>> I note that the Clang compiler has rejected the fixincludes approach
>> used by gcc.
>
> What do they do instead?
>
> Ian
>

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

* Re: a question about one part of gcc manual
  2011-04-26  6:24     ` ali hagigat
@ 2011-04-26  7:08       ` Ian Lance Taylor
  2011-04-26 11:07       ` ali hagigat
  1 sibling, 0 replies; 14+ messages in thread
From: Ian Lance Taylor @ 2011-04-26  7:08 UTC (permalink / raw)
  To: ali hagigat; +Cc: gcc-help, david.kirkby

ali hagigat <hagigatali@gmail.com> writes:

> When fixincludes is executed? Is it executed when installing gcc ONLY?

fixincludes is executed when building gcc.  The "fixed" header files are
installed when you run "make install".

> What is "include_next" directive in the section of 3.14 of gcc manual?

http://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html

Ian

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

* Re: a question about one part of gcc manual
  2011-04-26  6:24     ` ali hagigat
  2011-04-26  7:08       ` Ian Lance Taylor
@ 2011-04-26 11:07       ` ali hagigat
  2011-04-26 11:20         ` ali hagigat
  1 sibling, 1 reply; 14+ messages in thread
From: ali hagigat @ 2011-04-26 11:07 UTC (permalink / raw)
  To: Ian Lance Taylor, gcc-help

I appreciate you, Ian. What is the purpose of the manual from
"include_next" directive in the section of 3.14?


On Tue, Apr 26, 2011 at 7:26 AM, ali hagigat <hagigatali@gmail.com> wrote:
> When fixincludes is executed? Is it executed when installing gcc ONLY?
> What is "include_next" directive in the section of 3.14 of gcc manual?
>
>
> On Mon, Apr 25, 2011 at 10:22 PM, Ian Lance Taylor <iant@google.com> wrote:
>> David Kirkby <david.kirkby@onetel.net> writes:
>>
>>> I note that the Clang compiler has rejected the fixincludes approach
>>> used by gcc.
>>
>> What do they do instead?
>>
>> Ian
>>
>

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

* Re: a question about one part of gcc manual
  2011-04-26 11:07       ` ali hagigat
@ 2011-04-26 11:20         ` ali hagigat
  2011-04-26 12:40           ` ali hagigat
  0 siblings, 1 reply; 14+ messages in thread
From: ali hagigat @ 2011-04-26 11:20 UTC (permalink / raw)
  To: Ian Lance Taylor, gcc-help

OH, sorry you have replied to my question already. Sorry for this
message and take up your time.

On Tue, Apr 26, 2011 at 10:53 AM, ali hagigat <hagigatali@gmail.com> wrote:
> I appreciate you, Ian. What is the purpose of the manual from
> "include_next" directive in the section of 3.14?
>
>
> On Tue, Apr 26, 2011 at 7:26 AM, ali hagigat <hagigatali@gmail.com> wrote:
>> When fixincludes is executed? Is it executed when installing gcc ONLY?
>> What is "include_next" directive in the section of 3.14 of gcc manual?
>>
>>
>> On Mon, Apr 25, 2011 at 10:22 PM, Ian Lance Taylor <iant@google.com> wrote:
>>> David Kirkby <david.kirkby@onetel.net> writes:
>>>
>>>> I note that the Clang compiler has rejected the fixincludes approach
>>>> used by gcc.
>>>
>>> What do they do instead?
>>>
>>> Ian
>>>
>>
>

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

* Re: a question about one part of gcc manual
  2011-04-26 11:20         ` ali hagigat
@ 2011-04-26 12:40           ` ali hagigat
  2011-04-26 14:28             ` Jonathan Wakely
  2011-04-26 16:29             ` Ian Lance Taylor
  0 siblings, 2 replies; 14+ messages in thread
From: ali hagigat @ 2011-04-26 12:40 UTC (permalink / raw)
  To: Ian Lance Taylor, gcc-help

3.14 Options for Directory Search
If a standard system include directory, or a directory specified with
‘-isystem’, is also specified with ‘-I’, the ‘-I’ option will be
ignored. The directory will
still be searched but as a system directory at its normal position in
the system include chain.
-----------------------------------------------
What does that mean? Does it mean that the file is found at the
location -I has specified but it is marked as a system directory? or
the path specified by -i is ignored?


On Tue, Apr 26, 2011 at 10:55 AM, ali hagigat <hagigatali@gmail.com> wrote:
> OH, sorry you have replied to my question already. Sorry for this
> message and take up your time.
>
> On Tue, Apr 26, 2011 at 10:53 AM, ali hagigat <hagigatali@gmail.com> wrote:
>> I appreciate you, Ian. What is the purpose of the manual from
>> "include_next" directive in the section of 3.14?
>>
>>
>> On Tue, Apr 26, 2011 at 7:26 AM, ali hagigat <hagigatali@gmail.com> wrote:
>>> When fixincludes is executed? Is it executed when installing gcc ONLY?
>>> What is "include_next" directive in the section of 3.14 of gcc manual?
>>>
>>>
>>> On Mon, Apr 25, 2011 at 10:22 PM, Ian Lance Taylor <iant@google.com> wrote:
>>>> David Kirkby <david.kirkby@onetel.net> writes:
>>>>
>>>>> I note that the Clang compiler has rejected the fixincludes approach
>>>>> used by gcc.
>>>>
>>>> What do they do instead?
>>>>
>>>> Ian
>>>>
>>>
>>
>

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

* Re: a question about one part of gcc manual
  2011-04-26 12:40           ` ali hagigat
@ 2011-04-26 14:28             ` Jonathan Wakely
  2011-04-26 16:29             ` Ian Lance Taylor
  1 sibling, 0 replies; 14+ messages in thread
From: Jonathan Wakely @ 2011-04-26 14:28 UTC (permalink / raw)
  To: ali hagigat; +Cc: gcc-help

On 26 April 2011 08:08, ali hagigat wrote:
> 3.14 Options for Directory Search
> If a standard system include directory, or a directory specified with
> ‘-isystem’, is also specified with ‘-I’, the ‘-I’ option will be
> ignored. The directory will
> still be searched but as a system directory at its normal position in
> the system include chain.
> -----------------------------------------------
> What does that mean? Does it mean that the file is found at the
> location -I has specified but it is marked as a system directory? or
> the path specified by -i is ignored?

It means exactly what it says. I'm not sure how to make it clearer.
What part do you not understand?  The -I option is ignored.

If /usr/include is a standard system directory and you say
-I/usr/include then the -I option WILL BE IGNORED.  Any files in
/usr/include will only be found as part of searching the standard
system directories, when the standard system directories are searched
as normal, and obviously the standard system directories are marked as
system directories.

If you say -isystem /foo/bar -I /foo/bar then the -I option will be
ignored.   Any files in /foo/bar will only be found when searching the
standard system directories (including those specified by -isystem).

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

* Re: a question about one part of gcc manual
  2011-04-26 12:40           ` ali hagigat
  2011-04-26 14:28             ` Jonathan Wakely
@ 2011-04-26 16:29             ` Ian Lance Taylor
  2011-04-30 12:37               ` ali hagigat
  1 sibling, 1 reply; 14+ messages in thread
From: Ian Lance Taylor @ 2011-04-26 16:29 UTC (permalink / raw)
  To: ali hagigat; +Cc: gcc-help

ali hagigat <hagigatali@gmail.com> writes:

> 3.14 Options for Directory Search
> If a standard system include directory, or a directory specified with
> ‘-isystem’, is also specified with ‘-I’, the ‘-I’ option will be
> ignored. The directory will
> still be searched but as a system directory at its normal position in
> the system include chain.
> -----------------------------------------------
> What does that mean? Does it mean that the file is found at the
> location -I has specified but it is marked as a system directory? or
> the path specified by -i is ignored?

It means that if you say "-I dir -isystem dir" the -I option is
ignored.  It is as though you only said "-isystem dir".

Ian

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

* Re: a question about one part of gcc manual
  2011-04-26 16:29             ` Ian Lance Taylor
@ 2011-04-30 12:37               ` ali hagigat
  2011-04-30 22:47                 ` Jonathan Wakely
  0 siblings, 1 reply; 14+ messages in thread
From: ali hagigat @ 2011-04-30 12:37 UTC (permalink / raw)
  To: Ian Lance Taylor, david.kirkby, jwakely.gcc, gcc-help

3.14 Options for Directory Search
-Idir
This is to ensure that GCC’s procedure to fix buggy system
headers and the ordering for the include next directive are not
inadvertently hanged.
-----------------------------
Sorry I do not have the answer yet!! I understood "include_next"
directive but what is the procedure of GCC to fix the system headers?
When we specify a path with -I and it is ignored because there is the
same name in the system directories, how it can fix the system headers
then?


On Tue, Apr 26, 2011 at 6:58 PM, Ian Lance Taylor <iant@google.com> wrote:
>
> ali hagigat <hagigatali@gmail.com> writes:
>
> > 3.14 Options for Directory Search
> > If a standard system include directory, or a directory specified with
> > ‘-isystem’, is also specified with ‘-I’, the ‘-I’ option will be
> > ignored. The directory will
> > still be searched but as a system directory at its normal position in
> > the system include chain.
> > -----------------------------------------------
> > What does that mean? Does it mean that the file is found at the
> > location -I has specified but it is marked as a system directory? or
> > the path specified by -i is ignored?
>
> It means that if you say "-I dir -isystem dir" the -I option is
> ignored.  It is as though you only said "-isystem dir".
>
> Ian

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

* Re: a question about one part of gcc manual
  2011-04-30 12:37               ` ali hagigat
@ 2011-04-30 22:47                 ` Jonathan Wakely
       [not found]                   ` <mcrzkn79x1p.fsf@coign.corp.google.com>
  0 siblings, 1 reply; 14+ messages in thread
From: Jonathan Wakely @ 2011-04-30 22:47 UTC (permalink / raw)
  To: ali hagigat; +Cc: Ian Lance Taylor, david.kirkby, gcc-help

On 30 April 2011 12:39, ali hagigat wrote:
> 3.14 Options for Directory Search
> -Idir
> This is to ensure that GCC’s procedure to fix buggy system
> headers and the ordering for the include next directive are not
> inadvertently hanged.
> -----------------------------
> Sorry I do not have the answer yet!! I understood "include_next"
> directive but what is the procedure of GCC to fix the system headers?

GCC installs fixed versions of buggy system headers, as part of the
gcc installation tree.  Those headers are used instead of the original
system ones.


> When we specify a path with -I and it is ignored because there is the
> same name in the system directories, how it can fix the system headers
> then?

Because the system directories (including the one containing the fixed
headers) are still searched as normal.

It really isn't complicated: if a directory is considered as a system
directory and it is also named with -I, then the -I option is ignored.
 BUT THE DIRECTORY IS STILL SEARCHED AS A SYSTEM DIRECTORY.

Like Ian said, if you say:
  -isystem foo -I foo
then the -I option is ignored and it is equivalent to:
  -isystem foo

This ensures that if 'foo' contains buggy system headers then those
headers will not be found before the fixed versions, because gcc
searches the directory containing the fixed headers before it searches
other system directories.

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

* Re: a question about one part of gcc manual
       [not found]                   ` <mcrzkn79x1p.fsf@coign.corp.google.com>
@ 2011-05-01  2:43                     ` ali hagigat
  2011-05-01  3:35                       ` Ian Lance Taylor
  0 siblings, 1 reply; 14+ messages in thread
From: ali hagigat @ 2011-05-01  2:43 UTC (permalink / raw)
  To: Ian Lance Taylor, Jonathan Wakely, gcc-help

Thank you for the explanation but you did not explain the role of
"include_next" here!! You only insisted on some path is ignored!!!

I know that when we use -I  and there is the same pathname in the
system , -I is ignored!! But WHERE "include_next" is used?
Is it used with -isystem and in the file it is introducing ONLY?
Please rewrite this part of gcc manual, it is not clear at all!!

On Sun, May 1, 2011 at 3:17 AM, Ian Lance Taylor <iant@google.com> wrote:
> Jonathan Wakely <jwakely.gcc@gmail.com> writes:
>
>> On 30 April 2011 12:39, ali hagigat wrote:
>>> 3.14 Options for Directory Search
>>> -Idir
>>> This is to ensure that GCC’s procedure to fix buggy system
>>> headers and the ordering for the include next directive are not
>>> inadvertently hanged.
>>> -----------------------------
>>> Sorry I do not have the answer yet!! I understood "include_next"
>>> directive but what is the procedure of GCC to fix the system headers?
>>
>> GCC installs fixed versions of buggy system headers, as part of the
>> gcc installation tree.  Those headers are used instead of the original
>> system ones.
>>
>>
>>> When we specify a path with -I and it is ignored because there is the
>>> same name in the system directories, how it can fix the system headers
>>> then?
>>
>> Because the system directories (including the one containing the fixed
>> headers) are still searched as normal.
>>
>> It really isn't complicated: if a directory is considered as a system
>> directory and it is also named with -I, then the -I option is ignored.
>>  BUT THE DIRECTORY IS STILL SEARCHED AS A SYSTEM DIRECTORY.
>>
>> Like Ian said, if you say:
>>   -isystem foo -I foo
>> then the -I option is ignored and it is equivalent to:
>>   -isystem foo
>>
>> This ensures that if 'foo' contains buggy system headers then those
>> headers will not be found before the fixed versions, because gcc
>> searches the directory containing the fixed headers before it searches
>> other system directories.
>
>
> It is straightforward to test these options with a working version of
> gcc, to help clarify the documentation in your own mind.
>
> Ian
>

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

* Re: a question about one part of gcc manual
  2011-05-01  2:43                     ` ali hagigat
@ 2011-05-01  3:35                       ` Ian Lance Taylor
  0 siblings, 0 replies; 14+ messages in thread
From: Ian Lance Taylor @ 2011-05-01  3:35 UTC (permalink / raw)
  To: ali hagigat; +Cc: Jonathan Wakely, gcc-help

ali hagigat <hagigatali@gmail.com> writes:

> Thank you for the explanation but you did not explain the role of
> "include_next" here!! You only insisted on some path is ignored!!!

That is not what Jonathan said.  The -I option is ignored.  The path is
not ignored, because the -isystem option is not ignored.

> I know that when we use -I  and there is the same pathname in the
> system , -I is ignored!!

Yes, -I is ignored.

> But WHERE "include_next" is used?

Install gcc.  Look for .h files in the gcc install tree.  Look to see
which ones use #include_next.  Think about what it means.

> Is it used with -isystem and in the file it is introducing ONLY?

The -isystem option is independent of the #include_next directive,
except in the sense that -isystem gives directories for #include_next to
search.

> Please rewrite this part of gcc manual, it is not clear at all!!

Which part specifically is not clear?  As far as I know the -I and
-isystem options and the #include_next directive are described
correctly.

Ian

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

end of thread, other threads:[~2011-05-01  3:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-24 15:06 a question about one part of gcc manual ali hagigat
2011-04-25  6:37 ` David Kirkby
2011-04-25 18:01   ` Ian Lance Taylor
2011-04-26  6:24     ` ali hagigat
2011-04-26  7:08       ` Ian Lance Taylor
2011-04-26 11:07       ` ali hagigat
2011-04-26 11:20         ` ali hagigat
2011-04-26 12:40           ` ali hagigat
2011-04-26 14:28             ` Jonathan Wakely
2011-04-26 16:29             ` Ian Lance Taylor
2011-04-30 12:37               ` ali hagigat
2011-04-30 22:47                 ` Jonathan Wakely
     [not found]                   ` <mcrzkn79x1p.fsf@coign.corp.google.com>
2011-05-01  2:43                     ` ali hagigat
2011-05-01  3:35                       ` Ian Lance Taylor

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).