Bug 18654 - g++ fails for qregion.h (qt1x-devel)
Summary: g++ fails for qregion.h (qt1x-devel)
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-10-08 19:48 UTC by pdenis2
Modified: 2007-04-18 16:29 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2000-10-08 19:48:20 UTC
Embargoed:


Attachments (Terms of Use)

Description pdenis2 2000-10-08 19:48:18 UTC
Compiling, e.g., kgrep (http://www.logikos.com/devcom/projects/kgrep/)
fails for the qt-1.45 header qregion.h.  The compiler chokes on line 73 in
qregion.h which reads (I know it's ugly and appears to be a kludge of
sorts):

#if !(defined(__STRICT_ANSI__) && defined(_CC_GNU_)) && !defined(_CC_EDG_)
&& !defined(_CC_HP_) && !defined(_CC_HP_ACC_) && !defined(_CC_USLC_) &&
!defined(_CC_MWERKS_) && !defined(xor)

Error msg: 73:182 "defined" without an identifier


The lexer/parser can't handle the 'defined(xor)' at the end; apparently
trying to 'hide' the xor at the end of a series of (failed) &&s no longer
works.

If you don't want to bother with kgrep, just put an #include 'qregion.h'
line at the top of a "hello, world" source file and you'll get the same
error msg. Or put an "#if defined(somethingnotdefined) && defined(xor)"
into hello, world.

I don't really care about kgrep, but this seems to apply to any program
that wants qregion.h.  If this is the appropriate compiler behavior then
qt1x needs fixing.  BTW - kgrep compiled/ran fine under gcc 2.95.

Comment 1 Jakub Jelinek 2000-10-08 20:00:35 UTC
`xor' is special in C++ (like `and' and other keywords), you cannot
use them this way. Qt1 and KDE1 is full of these bugs, basically
unless you want to patch many things in it, you should use older
compiler for compiling Qt1 and KDE1 programs. KDE1/Qt1 programs
in the distribution are built with compat-egcs-c++ (command egcs++),
so basically you just need to make sure that instead of g++ the
Makefiles use egcs++ and -L/usr/lib in the CFLAGS, e.g. by:
export CXX="egcs++ -L/usr/lib" CC="egcs -L/usr/lib"
before running configure of those KDE1/Qt1 packages.
KDE2 is already valid C++, see http://master.kde.org/~bero/ for
rpms (or for KDE2 last beta look at the preview directory in RHL7).


Note You need to log in before you can comment on or make changes to this bug.