public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/30692]  New: GCC automatically fails to preprocess files with the "hpp" file extension
@ 2007-02-03 15:04 k04jg02 at kzoo dot edu
  2007-02-03 15:15 ` [Bug c/30692] " schwab at suse dot de
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: k04jg02 at kzoo dot edu @ 2007-02-03 15:04 UTC (permalink / raw)
  To: gcc-bugs

I want to use gcc's -E option to just have the preprocessor run on one of my
header files, to see if some macros expand correctly. GCC will do this happily
if the file's extension is .h, but not if it is .hpp. You can see this
trivially by typing in at the console:

$ touch blah.hpp
$ gcc -E blah.hpp
gcc: blah.hpp: linker input file unused because linking not done

I think this is because gcc uses the file extension to determine that you
probably want to compile C++ and so tries to link the libstdc++. But if you use
-E you don't want to link anything! You're just trying to use the preprocessor
to see if your macros are working. Renaming the file to have a ".h" extension
fixes the problem. Using g++ instead of gcc gives the same error.

I'm using gcc on Ubuntu Edgy, here's the --version line:

gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


-- 
           Summary: GCC automatically fails to preprocess files with the
                    "hpp" file extension
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: k04jg02 at kzoo dot edu


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


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

* [Bug c/30692] GCC automatically fails to preprocess files with the "hpp" file extension
  2007-02-03 15:04 [Bug c/30692] New: GCC automatically fails to preprocess files with the "hpp" file extension k04jg02 at kzoo dot edu
@ 2007-02-03 15:15 ` schwab at suse dot de
  2007-02-03 17:50 ` k04jg02 at kzoo dot edu
  2007-02-03 19:44 ` tromey at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: schwab at suse dot de @ 2007-02-03 15:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from schwab at suse dot de  2007-02-03 15:15 -------
.hpp is not a recognized extension.  If you want the file to be treated as a
C++ header precede it with `-xc++-header'.


-- 


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


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

* [Bug c/30692] GCC automatically fails to preprocess files with the "hpp" file extension
  2007-02-03 15:04 [Bug c/30692] New: GCC automatically fails to preprocess files with the "hpp" file extension k04jg02 at kzoo dot edu
  2007-02-03 15:15 ` [Bug c/30692] " schwab at suse dot de
@ 2007-02-03 17:50 ` k04jg02 at kzoo dot edu
  2007-02-03 19:44 ` tromey at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: k04jg02 at kzoo dot edu @ 2007-02-03 17:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from k04jg02 at kzoo dot edu  2007-02-03 17:50 -------
Erm, why does it matter whether or not it's somehow officially recognized? If I
tell GCC to run the C preprocessor on it, it shouldn't matter if I decide to
make my file extension ".cow". Also, .hpp is a very common extension for C++
projects, it seems silly for it not to be recognized.


-- 


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


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

* [Bug c/30692] GCC automatically fails to preprocess files with the "hpp" file extension
  2007-02-03 15:04 [Bug c/30692] New: GCC automatically fails to preprocess files with the "hpp" file extension k04jg02 at kzoo dot edu
  2007-02-03 15:15 ` [Bug c/30692] " schwab at suse dot de
  2007-02-03 17:50 ` k04jg02 at kzoo dot edu
@ 2007-02-03 19:44 ` tromey at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-02-03 19:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tromey at gcc dot gnu dot org  2007-02-03 19:44 -------
I think it matters because there are minor preprocessing differences
between languages.

I do agree that .hpp should be recognized.
That is PR 13676.  I'm going to close this as a duplicate.


*** This bug has been marked as a duplicate of 13676 ***


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2007-02-03 19:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-03 15:04 [Bug c/30692] New: GCC automatically fails to preprocess files with the "hpp" file extension k04jg02 at kzoo dot edu
2007-02-03 15:15 ` [Bug c/30692] " schwab at suse dot de
2007-02-03 17:50 ` k04jg02 at kzoo dot edu
2007-02-03 19:44 ` tromey at gcc dot gnu 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).