qt 4.2 and 4.3 issue with gcc 3.3.6

Marc Espie espie at nerim.net
Tue Apr 3 22:27:54 BST 2007


OpenBSD still uses gcc 3.3.6. The foreach construct defined in QtCore/qglobal.h
can barf on some usages. To wit, kdevelop 3.80.3 is unhappy with it:

[  7%] Building CXX object lib/sublime/CMakeFiles/sublime.dir/area.o
/spare/ports/x11/kde4/velop/w-kdevelop-3.80.3/kdevelop-3.80.3/lib/sublime/areawalkers.h:51: sorry, unimplemented: `
   method_call_expr' not supported by dump_expr
/spare/ports/x11/kde4/velop/w-kdevelop-3.80.3/kdevelop-3.80.3/lib/sublime/areawalkers.h:51: sorry, unimplemented: `
   method_call_expr' not supported by dump_expr


Those messages are produced by g++, and can be tracked down to a fragment
of gcc/cp/error.c:
#define sorry_for_unsupported_tree(T)                                      \
   sorry ("`%s' not supported by %s", tree_code_name[(int) TREE_CODE (T)], \
             __FUNCTION__)


as far as fixing this goes, the following patch does it:
--- src/corelib/global/qglobal.h.orig	Tue Apr  3 23:03:33 2007
+++ src/corelib/global/qglobal.h	Tue Apr  3 23:06:04 2007
@@ -1678,7 +1678,7 @@ typedef uint Flags;
 
 #endif /* Q_NO_TYPESAFE_FLAGS */
 
-#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL)
+#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_OS_OPENBSD)
 /* make use of typeof-extension */
 template <typename T>
 class QForeachContainer {

unless you have an easy way to detect which version of gcc is used...




More information about the kde-core-devel mailing list