You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to compile the latest version of ns3-ai (main branch), the following warning is shown:
[57/102] Building CXX object contrib/ai/examples/multi-bss/CMakeFiles/ns3ai_multibss.dir/multi-bss.cc.o
In file included from /usr/include/c++/12/istream:39,
from /usr/include/c++/12/fstream:38,
from /home/edalm/development/ns-3/ns-3.40/cmake-cache/CMakeFiles/stdlib_pch_exec.dir/cmake_pch.hxx:9,
from <command-line>:
In member function ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>]’,
inlined from ‘void PrintPythonPlotCSV(std::string)’ at /home/edu/development/ns-3/ns-3.40/contrib/ai/examples/multi-bss/multi-bss.cc:895:75:
/usr/include/c++/12/ostream:221:25: warning: ‘maxDistance’ may be used uninitialized [-Wmaybe-uninitialized]
221 | { return _M_insert(__f); }
| ~~~~~~~~~^~~~~
/home/edalm/development/ns-3/ns-3.40/contrib/ai/examples/multi-bss/multi-bss.cc: In function ‘void PrintPythonPlotCSV(std::string)’:
/home/edalm/development/ns-3/ns-3.40/contrib/ai/examples/multi-bss/multi-bss.cc:797:12: note: ‘maxDistance’ was declared here
797 | double maxDistance;
| ^~~~~~~~~~~
This warning can be solved by initializing the maxDistance variable when it's declared on line 797.
The text was updated successfully, but these errors were encountered:
edalm
changed the title
Unused variable warning (maxDistance)
warning: 'maxDistance' may be used uninitialized [-Wmaybe-uninitialized]
Oct 21, 2023
When trying to compile the latest version of ns3-ai (
main
branch), the following warning is shown:This warning can be solved by initializing the
maxDistance
variable when it's declared on line 797.The text was updated successfully, but these errors were encountered: