rtorrent icon indicating copy to clipboard operation
rtorrent copied to clipboard

command_dynamic.cc: uninitialized 'new_flags'

Open TurtleWilly opened this issue 2 years ago • 1 comments

…
command_dynamic.cc:330:14: warning: variable 'new_flags' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    else if (options.find("list") != std::string::npos)
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
command_dynamic.cc:340:50: note: uninitialized use occurs here
    return system_method_insert_object(new_args, new_flags);
                                                 ^~~~~~~~~
command_dynamic.cc:330:10: note: remove the 'if' if its condition is always true
    else if (options.find("list") != std::string::npos)
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
command_dynamic.cc:322:18: note: initialize the variable 'new_flags' to silence this warning
    int new_flags;
                 ^
                  = 0
…

(clang/ macOS)

TurtleWilly avatar Aug 13 '23 06:08 TurtleWilly

This has already been fixed in master as part of 7659cd0ec0e6c1ba6da40c4957487cc97d9c9023

kannibalox avatar Sep 30 '23 15:09 kannibalox