Error: invalid initialization of non-const reference of type ‘const RTT::corba::CConnPolicy*&’ - ace

I'm trying build the package orocos-toolchain from source.I have already build the ace and tao package inside ACE_wrapper which i downloaded from this page. But after i enter command" catkin_make_isolated --install -DENABLE_CORBA=ON -DCORBA_IMPLEMENTATION=TAO " I'm getting below error:
[100%] Building CXX object rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/CorbaLib.cpp.o
In file included from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:50:0:
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/RTTCorbaConversion.hpp: In static member function ‘static bool RTT::corba::AnyConversion<RTT::ConnPolicy>::update(const CORBA::Any&, RTT::corba::AnyConversion<RTT::ConnPolicy>::StdType&)’:
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/RTTCorbaConversion.hpp:313:18: error: invalid initialization of non-const reference of type ‘const RTT::corba::CConnPolicy*&’ from an rvalue of type ‘const RTT::corba::CConnPolicy*’
if ( any >>= result ) {
^
In file included from /home/dinesh/ws/underlay_isolated/build_isolated/rtt/install/rtt/transports/corba/ServiceC.h:114:0,
from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTypeTransporter.hpp:44,
from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTemplateProtocol.hpp:42,
from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:49:
/home/dinesh/ws/underlay_isolated/build_isolated/rtt/install/rtt/transports/corba/DataFlowC.h:1320:32: note: initializing argument 2 of ‘CORBA::Boolean operator>>=(const CORBA::Any&, const RTT::corba::CConnPolicy*&)’
RTT_CORBA_API ::CORBA::Boolean operator>>= (const ::CORBA::Any &, const RTT::corba::CConnPolicy *&);
^
In file included from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/DataFlowI.h:47:0,
from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/RemoteChannelElement.hpp:42,
from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTemplateProtocol.hpp:43,
from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:49:
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaConversion.hpp: In instantiation of ‘static bool RTT::corba::AnyConversion<std::vector<_Tp, _Alloc> >::update(const CORBA::Any&, RTT::corba::AnyConversion<std::vector<_Tp, _Alloc> >::StdType&) [with T = double; _Alloc = std::allocator<double>; RTT::corba::AnyConversion<std::vector<_Tp, _Alloc> >::StdType = std::vector<double>]’:
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTemplateProtocol.hpp:118:57: required from ‘bool RTT::corba::CorbaTemplateProtocol<T>::updateFromAny(const CORBA::Any*, RTT::base::DataSourceBase::shared_ptr) const [with T = std::vector<double>; RTT::base::DataSourceBase::shared_ptr = boost::intrusive_ptr<RTT::base::DataSourceBase>]’
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:208:1: required from here
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaConversion.hpp:259:18: error: invalid initialization of non-const reference of type ‘const CORBA::DoubleSeq*&’ from an rvalue of type ‘const CORBA::DoubleSeq*’
if ( any >>= result ) {
^
In file included from /home/dinesh/ws/underlay_isolated/build_isolated/rtt/install/rtt/transports/corba/ServiceC.h:51:0,
from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTypeTransporter.hpp:44,
from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTemplateProtocol.hpp:42,
from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:49:
/home/dinesh/ACE_wrappers/TAO/tao/AnyTypeCode/DoubleSeqA.h:86:41: note: initializing argument 2 of ‘CORBA::Boolean operator>>=(const CORBA::Any&, const CORBA::DoubleSeq*&)’
TAO_AnyTypeCode_Export ::CORBA::Boolean operator>>= (const ::CORBA::Any &, const CORBA::DoubleSeq *&);
^
In file included from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:42:0:
/home/dinesh/ACE_wrappers/TAO/tao/PortableServer/PortableServer.h: At global scope:
/home/dinesh/ACE_wrappers/TAO/tao/PortableServer/PortableServer.h:34:1: warning: ‘TAO_Requires_POA_Initializer’ defined but not used [-Wunused-variable]
TAO_Requires_POA_Initializer = TAO_POA_Initializer::init ();
^
rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/build.make:62: recipe for target 'rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/CorbaLib.cpp.o' failed
make[2]: *** [rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/CorbaLib.cpp.o] Error 1
CMakeFiles/Makefile2:935: recipe for target 'rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/all' failed
make[1]: *** [rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'rtt':
Command '['/home/dinesh/ws/underlay_isolated/install_isolated/env.sh', 'make', '-j4', '-l4']' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/dinesh/ws/underlay_isolated/build_isolated/rtt && /home/dinesh/ws/underlay_isolated/install_isolated/env.sh make -j4 -l4
Command failed, exiting.

Try to change CorbaType* result; to const CorbaType* result; on line 259 of rtt/rtt/transports/corba/CorbaConversion.hpp

Related

How does clang Diagnostics get source code?

I have a C file <ask.c> :
int func(int i) {
return i;
}
int main() {
int i;
int j = func(i);
return j;
}
When I try to compiler ask.c by command <clang ask.c -Wall>, I get a warning like
ask.c:7:18: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
int j = func(i);
^
ask.c:6:10: note: initialize the variable 'i' to silence this warning
int i;
^
= 0
1 warning generated.
Obviously this variable is indeed not initialized. When I went to explore how clang issued this warning, I found that it was through Diagnostics. The code of clang is as follows:
S.Diag(Use.getUser()->getBeginLoc(), diag::warn_uninit_var)
<< VD->getDeclName() << IsCapturedByBlock
<< Use.getUser()->getSourceRange();
define in Diagnostic*Kinds.td:
def warn_uninit_var : Warning<
"variable %0 is uninitialized when %select{used here|captured by block}1">,
InGroup<Uninitialized>, DefaultIgnore;
The exported information is output here, but what surprises me is that the source code of the error location is also output. How clang outputs the source code of the error location?
int j = func(i);
^
clang::Sema (your variable S in S.Diag) has access to the clang::SourceManager which in turn has access to all the raw bytes of all the input files, as well as non-files like macro expansion buffers expanded lazily if needed. The diagnostics printer uses the source manager interface to turn the clang::SourceLocation into file:line:col as well as a pointer to the raw bytes so it can print that line, as well as query the source manager to obtain the stack of macro instantiations or #include directives followed if applicable.

how to add a ModulePassManager in llvm pass?

I'm trying to add a ModulePassManager in llvm pass, because all pass is function pass, so all I added createModuleToFunctionPassAdaptor function, but compile error, I don't know how to solve it. does anybody know how to solve this problem. I tried this:
llvm::PreservedAnalyses DBogusFlow::run(llvm::Module &M,
llvm::ModuleAnalysisManager &MAM) {
bool Changed = runOnModule(M);
auto MPM = std::make_unique<ModulePassManager>();
MPM->addPass(createModuleToFunctionPassAdaptor(createAggressiveDCEPass()));
MPM->addPass(
createModuleToFunctionPassAdaptor(createInstructionCombiningPass()));
MPM->addPass(
createModuleToFunctionPassAdaptor(createCFGSimplificationPass()));
MPM->run(M, MAM);
return (Changed ? llvm::PreservedAnalyses::none()
: llvm::PreservedAnalyses::all());
}
below is the compile error
[ 50%] Building CXX object CMakeFiles/DBogusFlow.dir/lib/DBogusFlow.cpp.o
In file included from /usr/include/llvm/IR/PassManager.h:48,
from /home/v4kst1z/Desktop/ollvm-deobfuscator/lib/../include/DBogusFlow.h:12,
from /home/v4kst1z/Desktop/ollvm-deobfuscator/lib/DBogusFlow.cpp:9:
/usr/include/llvm/IR/PassManagerInternal.h: In instantiation of ‘PreservedAnalysesT llvm::detail::PassModel<IRUnitT, PassT, PreservedAnalysesT, AnalysisManagerT, ExtraArgTs>::run(IRUnitT&, AnalysisManagerT&, ExtraArgTs ...) [with IRUnitT = llvm::Function; PassT = llvm::FunctionPass*; PreservedAnalysesT = llvm::PreservedAnalyses; AnalysisManagerT = llvm::AnalysisManager<llvm::Function>; ExtraArgTs = {}]’:
/usr/include/llvm/IR/PassManagerInternal.h:83:22: required from here
/usr/include/llvm/IR/PassManagerInternal.h:85:17: error: request for member ‘run’ in ‘((llvm::detail::PassModel<llvm::Function, llvm::FunctionPass*, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >*)this)->llvm::detail::PassModel<llvm::Function, llvm::FunctionPass*, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::Pass’, which is of pointer type ‘llvm::FunctionPass*’ (maybe you meant to use ‘->’ ?)
85 | return Pass.run(IR, AM, ExtraArgs...);
| ~~~~~^~~
/usr/include/llvm/IR/PassManagerInternal.h: In instantiation of ‘llvm::StringRef llvm::detail::PassModel<IRUnitT, PassT, PreservedAnalysesT, AnalysisManagerT, ExtraArgTs>::name() const [with IRUnitT = llvm::Function; PassT = llvm::FunctionPass*; PreservedAnalysesT = llvm::PreservedAnalyses; AnalysisManagerT = llvm::AnalysisManager<llvm::Function>; ExtraArgTs = {}]’:
/usr/include/llvm/IR/PassManagerInternal.h:88:13: required from here
/usr/include/llvm/IR/PassManagerInternal.h:88:55: error: ‘name’ is not a member of ‘llvm::FunctionPass*’
88 | StringRef name() const override { return PassT::name(); }
| ~~~~~~~~~~~^~
make[2]: *** [CMakeFiles/DBogusFlow.dir/build.make:76: CMakeFiles/DBogusFlow.dir/lib/DBogusFlow.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:86: CMakeFiles/DBogusFlow.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Dart: Constant evaluation error. The method '[]' can't be invoked in a constant expression

I am getting an error on constant evaluation.
please take a look at this code:
class A {
final num a;
const A(this.a);
}
class B {
final A a;
const B(this.a);
}
main() {
const a = A(12);
const b = B(a); // this works fine
// I believe everything inside a const List is considered constant,
// please correct me if that is wrong
const aL = [ A(12), A(13) ]; // [ a, A(13) ] will not work either
const b2 = B(
aL[0], // here the error is happening
);
}
Error:
lib/logic/dartTest.dart:22:14: Error: Constant evaluation error:
const b2 = B(
^
lib/logic/dartTest.dart:23:7: Context: The method '[]' can't be invoked on '<A>[A {a: 12}, A {a: 13}]' in a constant expression. - 'A' is from 'package:t_angband/logic/dartTest.dart' ('lib/logic/dartTest.dart').
aL[0],
^
lib/logic/dartTest.dart:22:9: Context: While analyzing:
const b2 = B(
^
The list contains constant Object, then why the constant evaluation is failing? Shouldn't this be an analyzer issue? Am I missing something?
Thankyou.
Constant expressions can only build data, it cannot deconstruct it. You cannot call any methods on the constant objects except a handful of operations on numbers (and String.length, which also creates a number).
So, aL[0] is simply not a valid compile-time constant expression.
A possible fix may be to make b2 not constant!

Im Getting Errors From Terminal About My Code

I have almost finished my code, but terminal is giving me the following errors:
Tweak.xm:149:15: error: unused variable 'settings' [-Werror,-Wunused-variable]
NSDictionary *settings = [[NSDictionary alloc] initWithContentsOfFile:#"...
^
Tweak.xm:152:1: error: expected unqualified-id
if (settings) {
^
Tweak.xm:156:1: error: expected unqualified-id
if (lsSame) {
^
3 errors generated.
make[2]: *** [obj/Tweak.xm.c8cb265e.o] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [CustomColr.all.tweak.variables] Error 2
Here is my code:
http://pastie.org/10076062

How to mark as deprecated a single enum value in Delphi

I wish to have the following:
TEnumType = (
etValue1 = 1,
etValue2 = 2 deprecated,
etValue3 = 3);
It returns:
[DCC Error] unt_CollectionImportType.pas(19): E2029 ',' or ')' expected
but identifier 'deprecated' found.
Is there a way to instruct the compiler that this value is deprecated.
type
TEnumType = (
etValue1 = 1,
etDeprecated2 = 2, // was: etValue2; Renamed so we can deprecate it by name
etValue3 = 3);
const
etValue2 = etDeprecated2 deprecated; // Declares a constant mapped to the renamed enum value.

Resources