public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
       [not found] <bug-13675-6060@http.gcc.gnu.org/bugzilla/>
@ 2006-04-01 23:19 ` rupert dot swarbrick at lineone dot net
  2007-01-01 23:53 ` tim at klingt dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: rupert dot swarbrick at lineone dot net @ 2006-04-01 23:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from rupert dot swarbrick at lineone dot net  2006-04-01 23:19 -------
(In reply to comment #11)
> The same problem stays unresolved in GCC-3.4.4  

As far as I can tell, the problem is STILL unresolved with g++ 4.1, but there
is a workaround for users that I post here for information.

Create a "proxy" header. e.g. if there is some PCH enabled "gtk_includes.hh",
create "gtk_includes_proxy.hh", which is not precompiled and just has the
contents:
#ifndef GTK_INCLUDES_PROXY_HEADER
#define GTK_INCLUDES_PROXY_HEADER
#include "gtk_includes.hh"
#endif

This will ensure that the actual precompiled header is only included once per
module.


-- 

rupert dot swarbrick at lineone dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rupert dot swarbrick at
                   |                            |lineone dot net


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
       [not found] <bug-13675-6060@http.gcc.gnu.org/bugzilla/>
  2006-04-01 23:19 ` [Bug pch/13675] #including a precompiled header more than once in the same unit fails rupert dot swarbrick at lineone dot net
@ 2007-01-01 23:53 ` tim at klingt dot org
  2007-05-17 23:06 ` tim at klingt dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: tim at klingt dot org @ 2007-01-01 23:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from tim at klingt dot org  2007-01-01 23:53 -------
this is still a problem in the 4.2 branch


-- 

tim at klingt dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tim at klingt dot org


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
       [not found] <bug-13675-6060@http.gcc.gnu.org/bugzilla/>
  2006-04-01 23:19 ` [Bug pch/13675] #including a precompiled header more than once in the same unit fails rupert dot swarbrick at lineone dot net
  2007-01-01 23:53 ` tim at klingt dot org
@ 2007-05-17 23:06 ` tim at klingt dot org
  2007-11-27  3:06 ` l dot bermes at eurokey dot de
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: tim at klingt dot org @ 2007-05-17 23:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from tim at klingt dot org  2007-05-18 00:06 -------
4.2.0 still has this bug ... maybe someone with enough power can add this to
the "known to fail" section?


-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
       [not found] <bug-13675-6060@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2007-05-17 23:06 ` tim at klingt dot org
@ 2007-11-27  3:06 ` l dot bermes at eurokey dot de
  2008-04-01 10:59 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: l dot bermes at eurokey dot de @ 2007-11-27  3:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from l dot bermes at eurokey dot de  2007-11-27 03:06 -------
I got the same problems using gch in some projects. I'm using only one
precompiled header (defaults.h).
gcc is from SUSE Linux Enterprise Server 10
GNU C++ version 4.1.0 (SUSE Linux) (i586-suse-linux)
        compiled by GNU C version 4.1.0 (SUSE Linux).

strace shows that the fd for the pch is closed twice (but not opened twice)
which seems to lead to the error
[pid 20079] stat64("defaults.h.gch", {st_mode=S_IFREG|0644, st_size=9211224,
...}) = 0
[pid 20079] open("defaults.h.gch", O_RDONLY|O_NOCTTY) = 5
....
[pid 20079] close(5)                    = 0
[pid 20079] munmap(0xb7d18000, 4096)    = 0
[pid 20079] close(5)                    = -1 EBADF (Bad file descriptor)

The example from comment #11 leads to the same strace even if you use only
header1.h twice in test.cpp.

I removed all the not needed duplicates. This resolves most of the problems.

In some cases it was not possible to avoid the defaults.h in the headerfiles
because these are automatically generated source files (qt moc) which do not
include the precompiled header from the source so I had to put it in the
corresponding header. 
I used the define from the precompiled header in these headers to avoid the
conflict:
#ifndef __DEFAULTS_H__
#include "defaults.h"
#endif

But at the end I got a problem with the debug version.

As I did not find any duplicate includes in the header and the moc file.
I replaced the gch header by a copy which is not precompiled and the source
compiled succesfully (as expected).
I moved the precompiled header include from the header to the moc file for
testing and it compiled successfully. (suspicious)

Compiling with -v shows the following output:
GNU C++ version 4.1.0 (SUSE Linux) (i586-suse-linux)
        compiled by GNU C version 4.1.0 (SUSE Linux).
GGC heuristics: --param ggc-min-expand=77 --param ggc-min-heapsize=88425
Compiler executable checksum: 96db6faba1662b7eb3475b25f8211ddd
 as -V -Qy -o DrawWindow.moc.o /tmp/ccMxyQj6.s
GNU assembler version 2.17.50.0.6 (i386-redhat-linux-gnu) using BFD version
2.17.50.0.6 20061020
/tmp/ccMxyQj6.s: Assembler messages:
/tmp/ccMxyQj6.s:290: Error: file number 2 already allocated

The error does not occur if I use -g2 instead -g3 for compiling the precompiled
header but still using -g3 for all other files (with strace I see that the
precompiled header is used). But to avoid unpredictable results I'm using now
only -g2 to avoid conflicts.

Use the example from comment #11 to reproduce it without including header1.h in
the test.cpp:
$ cat test.cpp 
#include "header2.h" 

main() 
{ 
} 

compile with:
gcc -g3 -c -o header1.h.gch header1.h
gcc -g3 -c -o test test.cpp

If you use -g2 the bug does not occur.
If you include header1.h directly in test.cpp not via header2.h the bug does
not occur.

Is this a bug of "gcc" causing "as" to fail or a bug of "as"?
I will report it as a new bug if someone can check to whom it belongs.


-- 

l dot bermes at eurokey dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |l dot bermes at eurokey dot
                   |                            |de


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
       [not found] <bug-13675-6060@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2007-11-27  3:06 ` l dot bermes at eurokey dot de
@ 2008-04-01 10:59 ` jakub at gcc dot gnu dot org
  2008-10-17 20:20 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-01 10:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from jakub at gcc dot gnu dot org  2008-04-01 10:58 -------
Subject: Bug 13675

Author: jakub
Date: Tue Apr  1 10:58:02 2008
New Revision: 133790

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133790
Log:
        PR pch/13675
        * files.c (struct _cpp_file): Remove pch field.
        (pch_open_file): Don't set file->pch, just file->pchname.
        (should_stack_file): After pfile->cb.read_pch call
        free pchname and clear pchname, don't close file->fd.
        Test file->pchname instead of file->pch.  Don't close fd after cb.
        (_cpp_stack_include): Test file->pchname instead of file->pch.

        * c-pch.c (c_common_read_pch): On error close (fd) resp. fclose (f).

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-pch.c
    trunk/libcpp/ChangeLog
    trunk/libcpp/files.c


-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
       [not found] <bug-13675-6060@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2008-04-01 10:59 ` jakub at gcc dot gnu dot org
@ 2008-10-17 20:20 ` jakub at gcc dot gnu dot org
  2008-11-03 22:16 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-10-17 20:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from jakub at gcc dot gnu dot org  2008-10-17 20:19 -------
Fixed in 4.4.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
       [not found] <bug-13675-6060@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2008-10-17 20:20 ` jakub at gcc dot gnu dot org
@ 2008-11-03 22:16 ` pinskia at gcc dot gnu dot org
  2009-05-27 10:56 ` gafunchal at gmail dot com
  2009-05-27 14:35 ` gafunchal at gmail dot com
  8 siblings, 0 replies; 24+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-03 22:16 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.0


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
       [not found] <bug-13675-6060@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2008-11-03 22:16 ` pinskia at gcc dot gnu dot org
@ 2009-05-27 10:56 ` gafunchal at gmail dot com
  2009-05-27 14:35 ` gafunchal at gmail dot com
  8 siblings, 0 replies; 24+ messages in thread
From: gafunchal at gmail dot com @ 2009-05-27 10:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from gafunchal at gmail dot com  2009-05-27 10:56 -------
(In reply to comment #18)
> Fixed in 4.4.
> 

I still have this bug on 4.4.0, when using pch and -g3.


-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
       [not found] <bug-13675-6060@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2009-05-27 10:56 ` gafunchal at gmail dot com
@ 2009-05-27 14:35 ` gafunchal at gmail dot com
  8 siblings, 0 replies; 24+ messages in thread
From: gafunchal at gmail dot com @ 2009-05-27 14:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from gafunchal at gmail dot com  2009-05-27 14:34 -------
For the problem reported on Comment #16, see Bug #40272.


-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
       [not found] <bug-13675-4@http.gcc.gnu.org/bugzilla/>
@ 2014-02-16 13:18 ` jackie.rosen at hushmail dot com
  0 siblings, 0 replies; 24+ messages in thread
From: jackie.rosen at hushmail dot com @ 2014-02-16 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

Jackie Rosen <jackie.rosen at hushmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jackie.rosen at hushmail dot com

--- Comment #21 from Jackie Rosen <jackie.rosen at hushmail dot com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
                   ` (12 preceding siblings ...)
  2005-09-22 10:54 ` a dot darovskikh at compassplus dot ru
@ 2005-09-23 12:45 ` pinskia at gcc dot gnu dot org
  13 siblings, 0 replies; 24+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-23 12:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-23 12:45 -------
*** Bug 24029 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |a dot darovskikh at
                   |                            |compassplus dot ru


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
                   ` (11 preceding siblings ...)
  2004-06-25 22:02 ` geoffk at gcc dot gnu dot org
@ 2005-09-22 10:54 ` a dot darovskikh at compassplus dot ru
  2005-09-23 12:45 ` pinskia at gcc dot gnu dot org
  13 siblings, 0 replies; 24+ messages in thread
From: a dot darovskikh at compassplus dot ru @ 2005-09-22 10:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From a dot darovskikh at compassplus dot ru  2005-09-22 10:54 -------
The same problem stays unresolved in GCC-3.4.4  
My test is: 
 
$ cat header1.h 
$ cat header2.h 
#include "header1.h" 
 
$ cat test.cpp 
#include "header1.h" 
#include "header2.h" 
 
main() 
{ 
} 
 
$g++ -x c++ -c header1.h 
g++ test.cpp 
In file included from test.cpp:2: 
header2.h:1:21: calling fdopen: Bad file descriptor 
test.cpp:4: internal compiler error: Segmentation fault 
 

-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
                   ` (10 preceding siblings ...)
  2004-06-03  3:55 ` pegasus at ifdo dot pugmarks dot com
@ 2004-06-25 22:02 ` geoffk at gcc dot gnu dot org
  2005-09-22 10:54 ` a dot darovskikh at compassplus dot ru
  2005-09-23 12:45 ` pinskia at gcc dot gnu dot org
  13 siblings, 0 replies; 24+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2004-06-25 22:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From geoffk at gcc dot gnu dot org  2004-06-25 22:02 -------
That patch certainly isn't a good idea, marking things once-only changes the semantics.

-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
                   ` (9 preceding siblings ...)
  2004-04-24 20:45 ` v13 at it dot teithe dot gr
@ 2004-06-03  3:55 ` pegasus at ifdo dot pugmarks dot com
  2004-06-25 22:02 ` geoffk at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: pegasus at ifdo dot pugmarks dot com @ 2004-06-03  3:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pegasus at ifdo dot pugmarks dot com  2004-06-03 03:55 -------
Simpler test case:
touch a.h
echo '#include "a.h"' > a.c
echo '#include "a.h"' >> a.c
gcc a.h -o a.h.gch
gcc -c a.c -o a.o

The last gcc execution gives:
a.c:2:15: calling fdopen: Bad file descriptor

Possible workaround:
Disclamer: This is the first time I look at gcc's source code. This patch is
UNtested. Don't blame me if anything bad happens, etc.. 
This "works" by telling gcc to load the file once only. If loading the file more
than once was intentional, this will break your compilation.

--- gcc-3.4.0/gcc/cppfiles.c    2004-02-07 09:33:08.000000000 -0500
+++ gcc-3.4.0-new/gcc/cppfiles.c        2004-06-02 22:55:50.316126744 -0400
@@ -577,6 +577,7 @@
       pfile->cb.read_pch (pfile, file->path, file->fd, file->pchname);
       close (file->fd);
       file->fd = -1;
+      _cpp_mark_file_once_only (pfile, file);
       return false;
     }



-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
                   ` (8 preceding siblings ...)
  2004-04-24 19:09 ` pinskia at gcc dot gnu dot org
@ 2004-04-24 20:45 ` v13 at it dot teithe dot gr
  2004-06-03  3:55 ` pegasus at ifdo dot pugmarks dot com
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: v13 at it dot teithe dot gr @ 2004-04-24 20:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From v13 at it dot teithe dot gr  2004-04-24 19:09 -------
This is a way to reproduce it: 
 
hell:/tmp/2$ cat a.h 
#define A "koko" 
 
hell:/tmp/2$ cat b.h 
#include "a.h" 
#define C B 
 
hell:/tmp/2$ cat c.h  
#include "a.h" 
#include "b.h" 
#define D B 
 
hell:/tmp/2$ gcc a.h -o a.h.gch 
hell:/tmp/2$ gcc b.h -o b.h.gch 
hell:/tmp/2$ gcc c.h -o c.h.gch 
In file included from c.h:2: 
b.h:1:15: calling fdopen: Bad file descriptor 
 
hell:/tmp/2$ g++ a.h -o a.h.gch 
hell:/tmp/2$ g++ b.h -o b.h.gch 
hell:/tmp/2$ g++ c.h -o c.h.gch 
In file included from c.h:2: 
b.h:1:15: calling fdopen: Bad file descriptor 
 
But if we change c.h to: 
hell:/tmp/2$ cat c.h 
#include "b.h" 
#include "a.h" 
#define D B 
 
It works... 
 
So this happens when compiling header C which includes header B and A, and 
header B includes header A too, but only if header A is included in C before 
B. :) 

-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
                   ` (7 preceding siblings ...)
  2004-04-17 12:40 ` geoffk at gcc dot gnu dot org
@ 2004-04-24 19:09 ` pinskia at gcc dot gnu dot org
  2004-04-24 20:45 ` v13 at it dot teithe dot gr
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-24 19:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-24 18:54 -------
*** Bug 15118 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |v13 at it dot teithe dot gr


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
                   ` (6 preceding siblings ...)
  2004-04-17 10:41 ` geoffk at gcc dot gnu dot org
@ 2004-04-17 12:40 ` geoffk at gcc dot gnu dot org
  2004-04-24 19:09 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2004-04-17 12:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From geoffk at gcc dot gnu dot org  2004-04-17 08:43 -------
*** Bug 12707 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kgardas at objectsecurity
                   |                            |dot com


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
                   ` (5 preceding siblings ...)
  2004-04-17  9:29 ` geoffk at gcc dot gnu dot org
@ 2004-04-17 10:41 ` geoffk at gcc dot gnu dot org
  2004-04-17 12:40 ` geoffk at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2004-04-17 10:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From geoffk at gcc dot gnu dot org  2004-04-17 08:18 -------
This seems to be introduced by Neil's cppfiles.c rewrite, in particular with CVS HEAD as of 2003-07
-29 22:20:00 UTC, I get no error message and successful compilation on the testcase, and as of 2003
-07-29 22:35:00 UTC, I get the error message.  The only change between those two times was Neil's 
change.  (I am not sure if this was really caused by the change or just exposed by it.)

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |neil at daikokuya dot co dot
                   |                            |uk


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
                   ` (4 preceding siblings ...)
  2004-04-17  5:22 ` jbrandmeyer at earthlink dot net
@ 2004-04-17  9:29 ` geoffk at gcc dot gnu dot org
  2004-04-17 10:41 ` geoffk at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2004-04-17  9:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From geoffk at gcc dot gnu dot org  2004-04-17 08:12 -------
In the example, the file is called "pch-user1.cpp", not "pch-user1.c".  With identical files,

+ /tmp/gcc-20030730-1/bin/g++ -c -o pch-header.h.gch pch-header.h
+ /tmp/gcc-20030730-1/bin/g++ -c -o pch-user1.o pch-user1.cpp
In file included from pch-user1.cpp:2:
another-pch-user.h:1:24: calling fdopen: Bad file descriptor

but

+ /tmp/gcc-20030730-1/bin/gcc -c -o pch-header.h.gch pch-header.h
+ /tmp/gcc-20030730-1/bin/gcc -c -o pch-user1.o pch-user1.cpp
[completes successfully]

This is interesting (what is different about gcc vs. g++ in this case?), but mostly it's a gotcha for people 
like me who forget to use g++ and then can't reproduce the bug.


-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
                   ` (3 preceding siblings ...)
  2004-04-17  5:13 ` geoffk at gcc dot gnu dot org
@ 2004-04-17  5:22 ` jbrandmeyer at earthlink dot net
  2004-04-17  9:29 ` geoffk at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: jbrandmeyer at earthlink dot net @ 2004-04-17  5:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jbrandmeyer at earthlink dot net  2004-04-17 02:51 -------
Subject: Re:  #including a precompiled header more than once
	in the same unit fails

On Fri, 2004-04-16 at 20:43, geoffk at gcc dot gnu dot org wrote:
> ------- Additional Comments From geoffk at gcc dot gnu dot org  2004-04-17 00:43 -------
> The example doesn't appear to fail if you use 'gcc' instead of 'g++'.

Sure it does:

$ gcc-3.4 -v -c -o pch-user1.o pch-user1.c
Reading specs from
/home/jonathan/programs/lib/gcc/i686-pc-linux-gnu/3.4.0/specsConfigured
with: ../gcc/configure --enable-languages=c,c++
--prefix=/home/jonathan/programs --disable-checking
--program-suffix=-3.4 --enable-version-specific-runtime-libs
Thread model: posix
gcc version 3.4.0 20040416 (prerelease)
 /home/jonathan/programs/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1 -quiet
-v pch-user1.c -quiet -dumpbase pch-user1.c -mtune=pentiumpro
-auxbase-strip pch-user1.o -version -o /tmp/ccKySByl.s
ignoring nonexistent directory
"/home/jonathan/programs/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /home/jonathan/programs/include
 /home/jonathan/programs/lib/gcc/i686-pc-linux-gnu/3.4.0/include
 /usr/include
End of search list.
GNU C version 3.4.0 20040416 (prerelease) (i686-pc-linux-gnu)
        compiled by GNU C version 3.4.0 20040416 (prerelease).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64507
In file included from pch-user1.c:2:
another-pch-user.h:1:24: calling fdopen: Bad file descriptor

-Jonathan Brandmeyer



-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
                   ` (2 preceding siblings ...)
  2004-04-17  0:43 ` geoffk at gcc dot gnu dot org
@ 2004-04-17  5:13 ` geoffk at gcc dot gnu dot org
  2004-04-17  5:22 ` jbrandmeyer at earthlink dot net
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2004-04-17  5:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From geoffk at gcc dot gnu dot org  2004-04-17 00:43 -------
The example doesn't appear to fail if you use 'gcc' instead of 'g++'.

-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
  2004-01-14 12:29 ` [Bug pch/13675] " rwgk at yahoo dot com
  2004-01-15  2:00 ` geoffk at gcc dot gnu dot org
@ 2004-04-17  0:43 ` geoffk at gcc dot gnu dot org
  2004-04-17  5:13 ` geoffk at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2004-04-17  0:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From geoffk at gcc dot gnu dot org  2004-04-16 21:46 -------
Doesn't happen on Apple's gcc 3.3.  It would be helpful to know when this got introduced.

-- 


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
  2004-01-14 12:29 ` [Bug pch/13675] " rwgk at yahoo dot com
@ 2004-01-15  2:00 ` geoffk at gcc dot gnu dot org
  2004-04-17  0:43 ` geoffk at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2004-01-15  2:00 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-15 02:00:00
               date|                            |


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


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

* [Bug pch/13675] #including a precompiled header more than once in the same unit fails
  2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
@ 2004-01-14 12:29 ` rwgk at yahoo dot com
  2004-01-15  2:00 ` geoffk at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: rwgk at yahoo dot com @ 2004-01-14 12:29 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rwgk at yahoo dot com


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


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

end of thread, other threads:[~2014-02-16 13:18 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-13675-6060@http.gcc.gnu.org/bugzilla/>
2006-04-01 23:19 ` [Bug pch/13675] #including a precompiled header more than once in the same unit fails rupert dot swarbrick at lineone dot net
2007-01-01 23:53 ` tim at klingt dot org
2007-05-17 23:06 ` tim at klingt dot org
2007-11-27  3:06 ` l dot bermes at eurokey dot de
2008-04-01 10:59 ` jakub at gcc dot gnu dot org
2008-10-17 20:20 ` jakub at gcc dot gnu dot org
2008-11-03 22:16 ` pinskia at gcc dot gnu dot org
2009-05-27 10:56 ` gafunchal at gmail dot com
2009-05-27 14:35 ` gafunchal at gmail dot com
     [not found] <bug-13675-4@http.gcc.gnu.org/bugzilla/>
2014-02-16 13:18 ` jackie.rosen at hushmail dot com
2004-01-14  3:10 [Bug pch/13675] New: " jbrandmeyer at earthlink dot net
2004-01-14 12:29 ` [Bug pch/13675] " rwgk at yahoo dot com
2004-01-15  2:00 ` geoffk at gcc dot gnu dot org
2004-04-17  0:43 ` geoffk at gcc dot gnu dot org
2004-04-17  5:13 ` geoffk at gcc dot gnu dot org
2004-04-17  5:22 ` jbrandmeyer at earthlink dot net
2004-04-17  9:29 ` geoffk at gcc dot gnu dot org
2004-04-17 10:41 ` geoffk at gcc dot gnu dot org
2004-04-17 12:40 ` geoffk at gcc dot gnu dot org
2004-04-24 19:09 ` pinskia at gcc dot gnu dot org
2004-04-24 20:45 ` v13 at it dot teithe dot gr
2004-06-03  3:55 ` pegasus at ifdo dot pugmarks dot com
2004-06-25 22:02 ` geoffk at gcc dot gnu dot org
2005-09-22 10:54 ` a dot darovskikh at compassplus dot ru
2005-09-23 12:45 ` pinskia 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).