This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/1688: Includes causing extern "C" not to behave correctly (?)



>Number:         1688
>Category:       c++
>Synopsis:       Includes causing extern "C" not to behave correctly (?)
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 17 12:36:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Daniel Henninger
>Release:        gcc 2.95-2
>Organization:
>Environment:
Solaris 2.6
>Description:
While I'm not sure why it is doing this, when a sample
program as follows was compiled:
#include <tcl.h>
#include <tk.h>

int main() { }
If I compiled it with:
g++ -I/ncsu/tcl80/include crap.C, it would work fine,
bringing in the X headers from /usr/include/X11, which is
obviously in the default path.  On this system,
/usr/include/X11 is linked to /usr/openwin/share/include/X11
(/usr/openwin/include is linked to /usr/openwin/share/include
as well)  Anyway, if I recompile it with:
g++ -I/usr/openwin/include -I/ncsu/tcl80/include crap.C,
it fails complaining about ANSI C++ forbids declarition 'XXX'
with no type at many locations within Xlib.h.  Keep in mind
it is including the very same X header files as it did when
it was compiled without -I/usr/openwin/include specified.
We tried various combinations and it turns out that any
time the -I was added to specify where to find X11, it would
fail.  (we included linking /usr/openwin/include/X11 to
. and compiling with -I., it failed in the same manner)
After scanning the preprocessor output and everything we can
not come up with anything that "makes sense" as to why it's
not working.
>How-To-Repeat:
Just recompiling a program with X11/Xlib.h included will
show it.  Lose the tcl:
#include <X11/Xlib.h>
int main() {}
g++ -I/usr/openwin/include crap.C
same deal.
>Fix:
'fraid I don't have one
>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]