Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command_dynamic.cc: uninitialized 'new_flags' #1242

Open
TurtleWilly opened this issue Aug 13, 2023 · 1 comment
Open

command_dynamic.cc: uninitialized 'new_flags' #1242

TurtleWilly opened this issue Aug 13, 2023 · 1 comment

Comments

@TurtleWilly
Copy link

…
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)

@kannibalox
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants