From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4247 invoked by alias); 20 Aug 2002 10:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 4229 invoked by uid 71); 20 Aug 2002 10:06:01 -0000 Resent-Date: 20 Aug 2002 10:06:01 -0000 Resent-Message-ID: <20020820100601.4228.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, marcusma@lsl.co.uk Received: (qmail 4158 invoked by uid 61); 20 Aug 2002 10:05:39 -0000 Message-Id: <20020820100539.4157.qmail@sources.redhat.com> Date: Tue, 20 Aug 2002 04:46:00 -0000 From: marcusma@lsl.co.uk Reply-To: marcusma@lsl.co.uk To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7646: Inclusion of X11 header files in to a C++ header, causes error messages during compilation. X-SW-Source: 2002-08/txt/msg00397.txt.bz2 List-Id: >Number: 7646 >Category: c++ >Synopsis: Inclusion of X11 header files in to a C++ header, causes error messages during compilation. >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Aug 20 03:06:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Marcus MacWilliam >Release: gcc v3.1 >Organization: >Environment: Solaris 8, running on a SparcUltra 10. >Description: The following example code from Xlib.h: extern XSetTransientForHint( #if NeedFunctionPrototypes Display* /* display */, Window /* w */, Window /* prop_window */ #endif ); causes the following error during compilation: /usr/openwin/include/X11/Xlib.h:2099: ISO C++ forbids declaration of ` XSetTransientForHint' with no type What would be useful, is a compiler flag that allows headers to be treated as C headers, not C++. It is imperative that the X11 headers can be included, and that the C++ compiles. >How-To-Repeat: Create a file DummyX11.cpp with the following: #include #include int main () { cout << "Hello" << endl; } Compile with the following: g++ -I/usr/openwin/include DummyX11.cpp. This will produce the errors. >Fix: >Release-Note: >Audit-Trail: >Unformatted: