Bugzilla – Bug 2632
Uninitialized variable error
Last modified: 2017-02-02 10:51:07 UTC
Created attachment 2760 [details] Patch for initializing the variables. When compiling ns-3.26 in optimized mode using gcc (Debian 4.9.2-10) 4.9.2 on Debian 8 the following error appears: [1141/1816] Compiling src/lte/helper/radio-environment-map-helper.cc In file included from ./ns3/ptr.h:26:0, from ./ns3/object.h:27, from ../src/lte/helper/radio-environment-map-helper.h:26, from ../src/lte/helper/radio-environment-map-helper.cc:22: ./ns3/assert.h: In member function ‘void ns3::RadioEnvironmentMapHelper::RunOneIteration(double, double, double, double)’: ./ns3/assert.h:70:22: error: ‘y’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (!(condition)) \ ^ ../src/lte/helper/radio-environment-map-helper.cc:286:10: note: ‘y’ was declared here double y; ^ cc1plus: all warnings being treated as errors The attached patch fixes this bug, initializing the variable with value 0.0.
Thanks Luciano. Pushed to changeset changeset 12610 01c054e8aa95: http://code.nsnam.org/ns-3-dev/rev/01c054e8aa95