Bugzilla – Bug 2128
Compilation error on lte module in optimized mode
Last modified: 2015-07-10 04:25:05 UTC
The error is: Waf: Entering directory `/home/nat/Work/ns-3-dev-git/build' [1557/2076] cxx: src/lte/model/epc-x2.cc -> build/src/lte/model/epc-x2.cc.1.o In file included from ./ns3/epc-x2-header.h:24:0, from ../src/lte/model/epc-x2.cc:27: ./ns3/epc-x2-sap.h: In member function ‘void ns3::EpcX2::RecvFromX2cSocket(ns3::Ptr<ns3::Socket>)’: ./ns3/epc-x2-sap.h:311:10: error: ‘params.ns3::EpcX2Sap::ResourceStatusUpdateParams::targetCellId’ may be used uninitialized in this function [-Werror=maybe-uninitialized] struct ResourceStatusUpdateParams ^ ../src/lte/model/epc-x2.cc:350:52: note: ‘params.ns3::EpcX2Sap::ResourceStatusUpdateParams::targetCellId’ was declared here EpcX2SapUser::ResourceStatusUpdateParams params; I used the following configure line (gcc version 5.1.0 (GCC)): ./waf configure --enable-examples --disable-gtk --disable-tests -d optimized The problem is that "params.targetCellId" isn't initialized. A simple (but maybe wrong) patch is to add an initialization, for example: EpcX2SapUser::ResourceStatusUpdateParams params; + params.targetCellId = 0; params.enb1MeasurementId = x2ResStatUpdHeader.GetEnb1MeasurementId (); With this patch, it compiles fine.
*** This bug has been marked as a duplicate of bug 2143 ***