public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Pavel Shevaev <pacha.shevaev@gmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Precompiled headers issue: -c and -fpch-preprocess should be used  	together?
Date: Wed, 07 Apr 2010 14:36:00 -0000	[thread overview]
Message-ID: <mcrk4sjgwj5.fsf@dhcp-172-17-9-151.mtv.corp.google.com> (raw)
In-Reply-To: <d9c3f61a1003280029w248628b8te06fb8ee17a9fc73@mail.gmail.com> (Pavel Shevaev's message of "Sun\, 28 Mar 2010 11\:29\:29 +0400")

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

  reply	other threads:[~2010-04-07 14:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-29  7:57 Pavel Shevaev
2010-04-07 14:36 ` Ian Lance Taylor [this message]
2010-04-16 20:59   ` Pavel Shevaev
2010-04-17  3:23     ` Ian Lance Taylor
2010-04-19 17:51       ` Pavel Shevaev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mcrk4sjgwj5.fsf@dhcp-172-17-9-151.mtv.corp.google.com \
    --to=iant@google.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=pacha.shevaev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).