Bug 18654

Summary: g++ fails for qregion.h (qt1x-devel)
Product: [Retired] Red Hat Linux Reporter: pdenis2
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-08 19:48:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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).