Bug 13676 - GCC failes to recognize files ending in .hpp as headers to be precompiled
: GCC failes to recognize files ending in .hpp as headers to be precompiled
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: pch
: 3.4.0
: P2 normal
: 4.3.0
Assigned To: Not yet assigned to anyone
: http://gcc.gnu.org/ml/gcc-patches/200...
: patch
:
:
  Show dependency treegraph
 
Reported: 2004-01-14 03:18 UTC by jbrandmeyer
Modified: 2007-08-06 21:43 UTC (History)
7 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2005-11-02 01:53:49


Attachments
patch for 4.1 branch. (1.82 KB, patch)
2006-01-11 19:51 UTC, Pawel Sikora
Details | Diff
Updated patch including tcc for mainline (2.42 KB, patch)
2006-12-30 15:35 UTC, Alfred Minarik
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jbrandmeyer 2004-01-14 03:18:15 UTC
Pass any header file with a suffix ending in .hpp to the compiler.  If -c is
specified, you recieve the message that "linker input file foo.hpp ignored
because linking not done", and if -c is not specified, it is passed on verbatim
to the linker which cannot subsequently determine the file type.

I think the most robust fix for this is to supply an argument to the -x flag
such as "c++-pch" or "c-pch" to force the compiler to treat it as a header file
to be pre-compiled.  This would also enable projects that do more exotic things
with #include to take advantage of PCH.
Comment 1 Andrew Pinski 2004-01-14 03:32:22 UTC
Patch is here: <http://gcc.gnu.org/ml/gcc-patches/2003-01/msg01317.html>,
reviewed (almost 
a year later wow): <http://gcc.gnu.org/ml/gcc-patches/2004-01/msg01210.html>.
Comment 2 Andrew Pinski 2005-07-21 00:37:06 UTC
Someone should apply this patch.
Comment 3 Andrew Pinski 2005-12-09 03:05:46 UTC
*** Bug 25323 has been marked as a duplicate of this bug. ***
Comment 4 Pawel Sikora 2006-01-11 19:51:22 UTC
Created attachment 10625 [details]
patch for 4.1 branch.

please check-in this patch befor 4.1.0-final.
Comment 5 Pawel Sikora 2006-03-22 01:38:30 UTC
ping. 4.1 & 4.2 still need this patch.
Comment 6 Geoff Keating 2006-05-18 01:09:00 UTC
The author didn't respond to my question about copyright assignment, so I don't
think the patch can be applied.
Comment 7 Pawel Sikora 2006-08-31 20:22:05 UTC
(In reply to comment #6)
> The author didn't respond to my question about copyright assignment, so I don't
> think the patch can be applied.

it's weird to waiting years for respond about such trivial patch.
Comment 8 Andrew Pinski 2006-09-25 21:22:23 UTC
*** Bug 29221 has been marked as a duplicate of this bug. ***
Comment 9 Alfred Minarik 2006-09-26 18:08:19 UTC
Hello, well I did the paperworks then
http://gcc.gnu.org/ml/gcc-patches/2004-01/msg01299.html
and resent after that with minor modification too 
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00597.html

would be cool adding after another 2 years...
Comment 10 Tom Tromey 2006-12-28 01:38:22 UTC
Is this patch just waiting for someone to commit it?
The paperwork is all done?
If so please respond and I will check it in.
Comment 11 Alfred Minarik 2006-12-30 15:35:12 UTC
Created attachment 12847 [details]
Updated patch including tcc for mainline

Yes this is right. in Comment #4 there was an update of the first
version for current mainline.
Please note that Benjamin Kosnik has requested another C++ header type for
Template insantiation headers: tcc. 
I have included that then in an updated patch.
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00597.html

Just saw that I added hpp twice in cp/lang-specs.h. Corrected and
bootstraped/make checked just in case...(no problems)

Added this patch updated for mainline as attachment. 
if you prefere also adding tcc. Please take changelog from mentioned link.

Thanks.
Comment 12 Pawel Sikora 2007-01-02 20:14:41 UTC
and we'll wait another years to commit this trivial thing :>
Comment 13 Tom Tromey 2007-01-03 19:17:15 UTC
I'm not sure whether the updated patch can be committed without
another review.  I'll try to find out.
Comment 14 Tom Tromey 2007-02-03 19:44:08 UTC
*** Bug 30692 has been marked as a duplicate of this bug. ***
Comment 15 Tom Tromey 2007-02-03 19:45:41 UTC
I think you need to resubmit the updated patch.
Sorry about that.  But I don't think that, in general, an approval
still applies once the patch has been changed.

If you do it soon I will try to include this in my list of patches
when I ping about the cpp patch backlog.
Comment 16 Alfred Minarik 2007-02-04 17:23:50 UTC
(In reply to comment #15)
> I think you need to resubmit the updated patch.

Done http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00331.html
Comment 17 gerald@gcc.gnu.org 2007-08-06 11:10:33 UTC
Subject: Bug 13676

Author: gerald
Date: Mon Aug  6 11:10:19 2007
New Revision: 127239

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127239
Log:
    PR pch/13676
    * doc/invoke.texi: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.

cp:
    * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
    * g++spec.c (lang_specific_driver): Check them.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/g++spec.c
    trunk/gcc/cp/lang-specs.h
    trunk/gcc/doc/invoke.texi
Comment 18 Andrew Pinski 2007-08-06 21:43:59 UTC
Fixed.