public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: marcusma@lsl.co.uk
To: gcc-gnats@gcc.gnu.org
Subject: c++/7646: Inclusion of X11 header files in to a C++ header, causes error messages during compilation.
Date: Tue, 20 Aug 2002 04:46:00 -0000	[thread overview]
Message-ID: <20020820100539.4157.qmail@sources.redhat.com> (raw)


>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:


             reply	other threads:[~2002-08-20 10:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-20  4:46 marcusma [this message]
2002-08-20 12:16 Phil Edwards
2002-08-20 13:16 pme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020820100539.4157.qmail@sources.redhat.com \
    --to=marcusma@lsl.co.uk \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).