This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/7646: Inclusion of X11 header files in to a C++ header, causes error messages during compilation.
- From: marcusma at lsl dot co dot uk
- To: gcc-gnats at gcc dot gnu dot org
- Date: 20 Aug 2002 10:05:39 -0000
- Subject: c++/7646: Inclusion of X11 header files in to a C++ header, causes error messages during compilation.
- Reply-to: marcusma at lsl dot co dot uk
>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 <X11/Xlib.h>
#include <stdio>
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: