workaround mangle collision between decltype(Rf_error) and decltype(Rf_warning)#85
Conversation
|
I'm still getting the same problem on my current branch of arrow: |
romainfrancois
left a comment
There was a problem hiding this comment.
Minor comments, but not really fixing the issue
|
If the code prior to #71 works on clang and the current code works on gcc one approach would be to ifdef them? don't really enjoy playing compiler whack-a-mole though :( |
|
@jimhester if we can add a test with a minimal reproducer for the compilation failure I'd personally be comfortable adding the |
cpp11::cpp_source(code = '
#include <cpp11.hpp>
[[cpp11::register]]
std::string fun() {
cpp11::stop("b");
cpp11::warning("c");
}
', quiet = FALSE)
#> clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/Users/romainfrancois/.R/library/4.0/cpp11/include -I/usr/local/include -fPIC -Wall -O3 -Wall -Wimplicit-int-float-conversion -c /private/var/folders/4b/hn4fq98s6810s4ccv2f9hm2h0000gn/T/RtmpnWGTon/file16a78559d98cd/src/code_0.cpp -o /private/var/folders/4b/hn4fq98s6810s4ccv2f9hm2h0000gn/T/RtmpnWGTon/file16a78559d98cd/src/code_0.o
#> In file included from /private/var/folders/4b/hn4fq98s6810s4ccv2f9hm2h0000gn/T/RtmpnWGTon/file16a78559d98cd/src/code_0.cpp:2:
#> In file included from /Users/romainfrancois/.R/library/4.0/cpp11/include/cpp11.hpp:5:
#> In file included from /Users/romainfrancois/.R/library/4.0/cpp11/include/cpp11/as.hpp:9:
#> /Users/romainfrancois/.R/library/4.0/cpp11/include/cpp11/protect.hpp:240:58: error: definition with same mangled name '_ZNK5cpp117protect8functionIFvPKczEEclIJRS3_EEEDTclclL_ZNSt3__17declvalIPS4_EEDTclsr3std3__1E9__declvalIT_ELi0EEEvEEspclsr3stdE7declvalIOT_EEEEDpSE_' as another definition
#> decltype(std::declval<F*>()(std::declval<A&&>()...)) operator()(A&&... a) const {
#> ^
#> /Users/romainfrancois/.R/library/4.0/cpp11/include/cpp11/protect.hpp:240:58: note: previous definition is here
#> 1 error generated.
#> make: *** [/private/var/folders/4b/hn4fq98s6810s4ccv2f9hm2h0000gn/T/RtmpnWGTon/file16a78559d98cd/src/code_0.o] Error 1
#> Error in dyn.load(shared_lib, local = TRUE, now = TRUE): unable to load shared object '/var/folders/4b/hn4fq98s6810s4ccv2f9hm2h0000gn/T//RtmpnWGTon/file16a78559d98cd/src/code_0.so':
#> dlopen(/var/folders/4b/hn4fq98s6810s4ccv2f9hm2h0000gn/T//RtmpnWGTon/file16a78559d98cd/src/code_0.so, 6): image not foundCreated on 2020-08-10 by the reprex package (v0.3.0.9001) |
|
So is the ifdef solution the best option to go forward with this? |
|
I'm looking at Romain's reproducer. I'll either find a fix today or revert to #ifdefs |
d6e5528 to
25014d8
Compare
|
@romainfrancois PTAL |
romainfrancois
left a comment
There was a problem hiding this comment.
This does fix the issue with the reprex and I can compile arrow#cpp11.
Thanks @bkietz
In terms of style, I'm just wondering if this should rather be safe_noreturn[Rf_error] but I guess this is ok as not supposed to be used by code outside of cpp11.
|
@romainfrancois it is internal, so we can rewrite as |
I also cleaned up the signatures of detail:: functions, hopefully it's more readable