From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27189 invoked by alias); 14 Jan 2004 03:10:22 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 27181 invoked by uid 48); 14 Jan 2004 03:10:21 -0000 Date: Wed, 14 Jan 2004 03:10:00 -0000 From: "jbrandmeyer at earthlink dot net" To: gcc-bugs@gcc.gnu.org Message-ID: <20040114031017.13675.jbrandmeyer@earthlink.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug pch/13675] New: #including a precompiled header more than once in the same unit fails X-Bugzilla-Reason: CC X-SW-Source: 2004-01/txt/msg01437.txt.bz2 List-Id: This has also been observed on powerpc-apple-darwin6.8 with current sources as of 1pm US Eastern time today when configured with ../gcc/configure --enable-languages=c,c++ --program-suffix=-3.4 --enable-version-specific-runtime-libs Both the C and C++ compilers are affected. If a header file is precompiled and #included more than once in the same compilation unit, the second inclusion generates an error like "filename:linenumber:columnnumber calling fdopen: Bad file descriptor" Consider this trivial example: -----------pch-header.h------- #ifndef PCH_HEADER_TEST_H #define PCH_HEADER_TEST_H extern int i; #endif ----------another-pch-user.h------- #include "pch-header.h" ----------pch-user1.cpp------- #include "pch-header.h" #include "another-pch-user.h" ---------------end---------- $ g++-3.4 -c -o pch-header.h.gch pch-header.h $ g++-3.4 -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 $ g++-3.4 -v Reading specs from /home/jonathan/lib/gcc/i686-pc-linux-gnu/3.4.0/specs Configured with: ../gcc/configure --enable-languages=c,c++ --program-suffix=-3.4 --disable-checking --prefix=/home/jonathan Thread model: posix gcc version 3.4.0 20040108 (experimental) -- Summary: #including a precompiled header more than once in the same unit fails Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: pch AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jbrandmeyer at earthlink dot net CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13675