Bug #1375
closeduserspace-rcu-0.14.0: /usr/include/urcu/wfcqueue.h has duplicate definitions of cds_wfcq_head_cast_cpp()
0%
Description
/usr/include/urcu/wfcqueue.h has duplicate definitions of cds_wfcq_head_cast_cpp() at line 505 and again at line 511.
Looks like a cut-and-paste mistake
Updated by Kaleb KEITHLEY over 1 year ago
Updated by Michael Jeanson over 1 year ago
The type of the 'head' parameter differs, that should be valid in C++
static inline cds_wfcq_head_ptr_t cds_wfcq_head_cast_cpp(struct __cds_wfcq_head *head) static inline cds_wfcq_head_ptr_t cds_wfcq_head_cast_cpp(struct cds_wfcq_head *head)
What's the compiler error in nfs-ganesha ?
Updated by Kaleb KEITHLEY over 1 year ago
/usr/include/urcu/wfcqueue.h:511:35: error: conflicting declaration of C function 'cds_wfcq_head_ptr_t cds_wfcq_head_cast_cpp(cds_wfcq_head*)'
511 | static inline cds_wfcq_head_ptr_t cds_wfcq_head_cast_cpp(struct cds_wfcq_head *head)
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/urcu/wfcqueue.h:505:35: note: previous declaration 'cds_wfcq_head_ptr_t cds_wfcq_head_cast_cpp(__cds_wfcq_head*)'
505 | static inline cds_wfcq_head_ptr_t cds_wfcq_head_cast_cpp(struct __cds_wfcq_head *head)
| ^~~~~~~~~~~~~~~~~~~~
There are more errors after that too. Full build log at https://kojipkgs.fedoraproject.org/work/tasks/7776/100647776/build.log
Updated by Kaleb KEITHLEY over 1 year ago
[ 42%] Building CXX object monitoring/CMakeFiles/monitoring.dir/monitoring.cc.o
cd /builddir/build/BUILD/nfs-ganesha-5.1/src/redhat-linux-build/monitoring && /usr/bin/g++ -DHAS_DOFF -D_GNU_SOURCE=1 -I/usr/include/uuid -I/builddir/build/BUILD/nfs-ganesha-5.1/src/redhat-linux-build/include -I/builddir/build/BUILD/nfs-ganesha-5.1/src/include -I/builddir/build/BUILD/nfs-ganesha-5.1/src/include/os/linux -I/include -I/usr/include/ntirpc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -O2 -g -DNDEBUG -std=gnu++17 -fPIC -MD -MT monitoring/CMakeFiles/monitoring.dir/monitoring.cc.o -MF CMakeFiles/monitoring.dir/monitoring.cc.o.d -o CMakeFiles/monitoring.dir/monitoring.cc.o -c /builddir/build/BUILD/nfs-ganesha-5.1/src/monitoring/monitoring.cc
...
In file included from /usr/include/urcu/call-rcu.h:33,
from /usr/include/urcu/urcu-bp.h:197,
from /usr/include/urcu-bp.h:2,
from /builddir/build/BUILD/nfs-ganesha-5.1/src/include/fsal_api.h:44,
from /builddir/build/BUILD/nfs-ganesha-5.1/src/include/fsal.h:63,
from /builddir/build/BUILD/nfs-ganesha-5.1/src/include/nfs_convert.h:42,
from /builddir/build/BUILD/nfs-ganesha-5.1/src/monitoring/monitoring.cc:38:
/usr/include/urcu/wfcqueue.h:511:35: error: conflicting declaration of C function 'cds_wfcq_head_ptr_t cds_wfcq_head_cast_cpp(cds_wfcq_head*)'
511 | static inline cds_wfcq_head_ptr_t cds_wfcq_head_cast_cpp(struct cds_wfcq_head *head)
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/urcu/wfcqueue.h:505:35: note: previous declaration 'cds_wfcq_head_ptr_t cds_wfcq_head_cast_cpp(__cds_wfcq_head*)'
505 | static inline cds_wfcq_head_ptr_t cds_wfcq_head_cast_cpp(struct __cds_wfcq_head *head)
| ^~~~~~~~~~~~~~~~~~~~
Updated by Kaleb KEITHLEY over 1 year ago
I think the hint is that for some reason the compiler thinks these are both C functions (and not C++); "... conflicting declaration of C function..." which is not valid in C.
As to why the compiler thinks they are C functions though is anyone's guess.
Updated by Michael Jeanson over 1 year ago
I'll try to reproduce this locally and see what we can do.
Updated by Kaleb KEITHLEY over 1 year ago
I think it's probably some sloppy nexted 'extern "C" { ... } in a patch we got from g****e that wasn't caught before with userspace-rcu-13 which didn't have any c++ in wfcqueue.h
Updated by Michael Jeanson over 1 year ago
I indeed get the same error if I include 'urcu/wfcqueue.h' inside an 'extern "C"'.
Userspace-RCU 0.13 had some C++ sprinkled here and there but 0.14 is the first release with proper end-to-end support for C++.
Updated by Kaleb KEITHLEY over 1 year ago
I cleaned up the ganesha headers, eliminating the nested 'extern "C" {...}' and have a successful build. You can close this a not a bug. Sorry for the false alarm.
Updated by Michael Jeanson over 1 year ago
- Status changed from New to Resolved
Ok, thanks for the follow-up.