Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Aug 2009 04:03:28 GMT
From:      Stas Timokhin <stast@bsdportal.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/137443: Including /usr/include/rpc/xdr.h fails with C++
Message-ID:  <200908050403.n7543SfM022461@www.freebsd.org>
Resent-Message-ID: <200908050410.n754A3Cg026702@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         137443
>Category:       misc
>Synopsis:       Including /usr/include/rpc/xdr.h fails with C++
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 05 04:10:03 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Stas Timokhin
>Release:        8.0-CURRENT
>Organization:
None
>Environment:
FreeBSD home.stasyan.com 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Fri Jun 12 14:30:16 NOVST 2009     root@home.stasyan.com:/usr/src/sys/i386/compile/EASTERN200906  i386

>Description:
Building of C++ application (Salome) fail with current version rpc/xdr.h header:
====================
In file included from ../.././../src/Communication/Receivers.cxx:239,
                 from ../.././../src/Communication/Receivers.hxx:151,
                 from ../.././../src/Communication/ReceiverFactory.cxx:27:
/usr/include/rpc/xdr.h:125: error: conflicting declaration 'typedef struct __rpc_xdr XDR'
./.././../src/Communication/Receivers.hxx:127: error: 'struct XDR' has a previous declaration as 'struct XDR'
/usr/include/rpc/xdr.h: In function 'int xdr_getint32(XDR*, int32_t*)':
/usr/include/rpc/xdr.h:168: error: invalid use of incomplete type 'struct XDR'
./.././../src/Communication/Receivers.hxx:127: error: forward declaration of 'struct XDR'
/usr/include/rpc/xdr.h: In function 'int xdr_putint32(XDR*, int32_t*)':
/usr/include/rpc/xdr.h:180: error: invalid use of incomplete type 'struct XDR'
./.././../src/Communication/Receivers.hxx:127: error: forward declaration of 'struct XDR'
In file included from ../.././../src/Communication/Receivers.hxx:151,
======================



>How-To-Repeat:

>Fix:
Replace all "__rpc_xdr" to "XDR" in /usr/include/rpc/xdr.h in typedef struct  XDR.
C-applications (net/samba3, for example) and C++ applications (salome, not in ports yet) will be build OK.



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908050403.n7543SfM022461>