public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Precompiled headers issue: -c and -fpch-preprocess should be used   together?
@ 2010-03-29  7:57 Pavel Shevaev
  2010-04-07 14:36 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Shevaev @ 2010-03-29  7:57 UTC (permalink / raw)
  To: gcc-help

Folks, I'm using gcc-4.4.1(4.4.1-4ubuntu9 to be precise) on Ubuntu and
after trying to make PCH work properly for some time I found that
precompiled headers are not used if -c option used. Experimenting with
different options I discovered that it's the -fpch-preprocess option
which enables PCH in this case.

Is it an expected behavior? If yes, maybe it should be documented here
http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html in order to
save some time for others :)

-- 
Best regards, Pavel

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

* Re: Precompiled headers issue: -c and -fpch-preprocess should be used   together?
  2010-03-29  7:57 Precompiled headers issue: -c and -fpch-preprocess should be used together? Pavel Shevaev
@ 2010-04-07 14:36 ` Ian Lance Taylor
  2010-04-16 20:59   ` Pavel Shevaev
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2010-04-07 14:36 UTC (permalink / raw)
  To: Pavel Shevaev; +Cc: gcc-help

Pavel Shevaev <pacha.shevaev@gmail.com> writes:

> Folks, I'm using gcc-4.4.1(4.4.1-4ubuntu9 to be precise) on Ubuntu and
> after trying to make PCH work properly for some time I found that
> precompiled headers are not used if -c option used. Experimenting with
> different options I discovered that it's the -fpch-preprocess option
> which enables PCH in this case.
>
> Is it an expected behavior? If yes, maybe it should be documented here
> http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html in order to
> save some time for others :)

It is very likely that you are using ccache or distcc.  Those tools
first preprocess the C source code and then compile it.  It's true
that if you are preprocessing, you need to use the -fpch-preprocess
option.  However, -fpch-preprocess is not required if you do not
preprocess, and omitting it should work fine when using gcc proper
rathre than ccache or distcc.

Ian

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

* Re: Precompiled headers issue: -c and -fpch-preprocess should be used   together?
  2010-04-07 14:36 ` Ian Lance Taylor
@ 2010-04-16 20:59   ` Pavel Shevaev
  2010-04-17  3:23     ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Shevaev @ 2010-04-16 20:59 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

> It is very likely that you are using ccache or distcc.

You are absolutely correct, I'm using both ccache and distcc.

> Those tools
> first preprocess the C source code and then compile it.  It's true
> that if you are preprocessing, you need to use the -fpch-preprocess
> option.  However, -fpch-preprocess is not required if you do not
> preprocess, and omitting it should work fine when using gcc proper
> rathre than ccache or distcc.

Thanks for the explanation! I just wonder why not putting this info on
the pch help page somewhere?

-- 
Best regards, Pavel

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

* Re: Precompiled headers issue: -c and -fpch-preprocess should be used  together?
  2010-04-16 20:59   ` Pavel Shevaev
@ 2010-04-17  3:23     ` Ian Lance Taylor
  2010-04-19 17:51       ` Pavel Shevaev
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2010-04-17  3:23 UTC (permalink / raw)
  To: Pavel Shevaev; +Cc: gcc-help

Pavel Shevaev <pacha.shevaev@gmail.com> writes:

>> Those tools
>> first preprocess the C source code and then compile it.  It's true
>> that if you are preprocessing, you need to use the -fpch-preprocess
>> option.  However, -fpch-preprocess is not required if you do not
>> preprocess, and omitting it should work fine when using gcc proper
>> rathre than ccache or distcc.
>
> Thanks for the explanation! I just wonder why not putting this info on
> the pch help page somewhere?

It's kind of special purpose and I think it would fit better on
http://gcc.gnu.org/wiki/FAQ .  Want to add an entry?

Ian

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

* Re: Precompiled headers issue: -c and -fpch-preprocess should be used   together?
  2010-04-17  3:23     ` Ian Lance Taylor
@ 2010-04-19 17:51       ` Pavel Shevaev
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Shevaev @ 2010-04-19 17:51 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

> It's kind of special purpose and I think it would fit better on
> http://gcc.gnu.org/wiki/FAQ .  Want to add an entry?

I'll give it a try :)

-- 
Best regards, Pavel

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

end of thread, other threads:[~2010-04-19 11:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-29  7:57 Precompiled headers issue: -c and -fpch-preprocess should be used together? Pavel Shevaev
2010-04-07 14:36 ` Ian Lance Taylor
2010-04-16 20:59   ` Pavel Shevaev
2010-04-17  3:23     ` Ian Lance Taylor
2010-04-19 17:51       ` Pavel Shevaev

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