Package: lesstif2-dev
Version: 0.94.4-2

About 7 packages [1] in the archive fail to build with recent versions
of the gcc-snapshot package, i.e. a pre-release of GCC 4.2 because of
a conflict between lesstif2-dev and libxt-dev.  The problem is that
external variables/functions are defined both in a C and C++ context,
as you can see in this simple example:

42059:[EMAIL PROTECTED]: ~] /usr/lib/gcc-snapshot/bin/g++ -c t.cc
t.cc:1: error: previous declaration of 'int i' with 'C++' linkage
t.cc:4: error: conflicts with new declaration with 'C' linkage
42060:[EMAIL PROTECTED]: ~] cat t.cc
extern int i;

extern "C" {
        extern int i;
}

According to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27227#c8 this is
not valid, so please investigate.

The problem is that the lesstif header explicitly uses 'extern "C"'
when it is in C++ mode, but this seems bogus.  Can you talk to
upstream to see why this was added?

Here's a trivial example of the problem:

1707:[EMAIL PROTECTED]: ~] cat test.cc
#include <Xm/VendorSP.h>
1708:[EMAIL PROTECTED]: ~] /usr/lib/gcc-snapshot/bin/g++ -c test.cc
/usr/include/X11/VendorP.h:87: error: previous declaration of 
'VendorShellClassRec vendorShellClassRec' with 'C++' linkage
/usr/include/Xm/VendorSP.h:58: error: conflicts with new declaration with 'C' 
linkage
zsh: exit 1     /usr/lib/gcc-snapshot/bin/g++ -c test.cc
1709:[EMAIL PROTECTED]: ~]

The following patch makes the build failure go away:

--- /usr/include/Xm/VendorSP.h  2006-07-07 15:58:04.000000000 +0200
+++ VendorSP.h  2006-07-07 15:58:19.000000000 +0200
@@ -30,10 +30,6 @@
 #include <Xm/VendorS.h>
 #include <X11/ShellP.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 XMLIBEXPORT extern Cardinal _XmFilterResources(XtResource *resources,
                                   Cardinal numResources,
                                   WidgetClass filterClass,
@@ -57,9 +53,4 @@
 
 XMLIBEXPORT extern VendorShellClassRec  vendorShellClassRec;
 
-
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _XM_VENDORSP_H */


> Automatic build of xmpi_2.2.3b8-10 on test.track.rz.uni-augsburg.de by 
> sbuild/powerpc 0.47
...
> if mpic++.lam -DHAVE_CONFIG_H -I. -I. -I.  -I../../src    -g -O2 -MT 
> xmpi_misc.o -MD -MP -MF ".deps/xmpi_misc.Tpo" \
>         -c -o xmpi_misc.o `test -f 'xmpi_misc.cc' || echo './'`xmpi_misc.cc; \
>       then mv -f ".deps/xmpi_misc.Tpo" ".deps/xmpi_misc.Po"; \
>       else rm -f ".deps/xmpi_misc.Tpo"; exit 1; \
>       fi
> /usr/include/X11/VendorP.h:87: error: previous declaration of 
> 'VendorShellClassRec vendorShellClassRec' with 'C++' linkage
> /usr/include/Xm/VendorSP.h:58: error: conflicts with new declaration with 'C' 
> linkage
> make[3]: *** [xmpi_misc.o] Error 1
> make[3]: Leaving directory `/build/tbm/xmpi-2.2.3b8/src/xmpi'

[1] At the moment, the following packages fail to build with GCC 4.2:

ddd_1:3.3.11-1
dx_1:4.4.0-2
inventor_2.1.5-10-9
tcm_2.20+TSQD-3
twpsk_2.1+2.2beta1-7
xmpi_2.2.3b8-10
xpdf_3.01-8
-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to