8000 shell: fix sometimes-uninitialized error by mlafeldt · Pull Request #16761 · duckdb/duckdb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

shell: fix sometimes-uninitialized error #16761

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

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

mlafeldt
Copy link
Contributor

This is a follow-up to #16594, which introduced the problem.

Thanks to @Tishj for bringing it up here.

(I only encountered the error with make CXXFLAGS=-Wall, which makes me wonder a) why that's not the default and b) why CI didn't catch this bug?)

@Tishj
Copy link
Contributor
Tishj commented Mar 20, 2025

Thanks for the speedy fix 🚀

@Mytherin
Copy link
Collaborator

(I only encountered the error with make CXXFLAGS=-Wall, which makes me wonder a) why that's not the default and b) why CI didn't catch this bug?)

It's the default on MacOS - which we don't run as part of the PR CI (but only as part of the extended nightly CI).

@Mytherin Mytherin merged commit baf27fa into duckdb:main Mar 21, 2025
27 checks passed
@Mytherin
Copy link
Collaborator

Thanks!

@carlopi
Copy link
Contributor
carlopi commented Mar 21, 2025

This indeed turned out as error in the nightly CI runs:

/Users/runner/work/duckdb/duckdb/tools/shell/shell.cpp:4644:13: error: variable 'rc' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
        } else if (!is_duckdb_rc) {
                   ^~~~~~~~~~~~~
/Users/runner/work/duckdb/duckdb/tools/shell/shell.cpp:4650:9: note: uninitialized use occurs here
        return rc == 0;
               ^~
/Users/runner/work/duckdb/duckdb/tools/shell/shell.cpp:4644:9: note: remove the 'if' if its condition is always true
        } else if (!is_duckdb_rc) {
               ^~~~~~~~~~~~~~~~~~~
/Users/runner/work/duckdb/duckdb/tools/shell/shell.cpp:[463](https://github.com/duckdb/duckdb/actions/runs/13982092211/job/39149266346#step:6:464)5:8: note: initialize the variable 'rc' to silence this warning
        int rc;
              ^
               = 0
1 error generated.

great it's already fixed!

@mlafeldt mlafeldt deleted the shell-bail-more-followup branch March 21, 2025 09:03
@mlafeldt
Copy link
Contributor Author

Nice, and I added export CXXFLAGS=-Wall to my local .envrc to catch these problems locally before submitting a new PR.

krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 15, 2025
Issue duckdb/duckdb#16250: Window Range Performance (duckdb/duckdb#16765)
shell: fix sometimes-uninitialized error (duckdb/duckdb#16761)
[Python Dev] Fix the versioning of the nightly python builds (duckdb/duckdb#16739)
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 15, 2025
Issue duckdb/duckdb#16250: Window Range Performance (duckdb/duckdb#16765)
shell: fix sometimes-uninitialized error (duckdb/duckdb#16761)
[Python Dev] Fix the versioning of the nightly python builds (duckdb/duckdb#16739)
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 16, 2025
Issue duckdb/duckdb#16250: Window Range Performance (duckdb/duckdb#16765)
shell: fix sometimes-uninitialized error (duckdb/duckdb#16761)
[Python Dev] Fix the versioning of the nightly python builds (duckdb/duckdb#16739)
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 16, 2025
Issue duckdb/duckdb#16250: Window Range Performance (duckdb/duckdb#16765)
shell: fix sometimes-uninitialized error (duckdb/duckdb#16761)
[Python Dev] Fix the versioning of the nightly python builds (duckdb/duckdb#16739)
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 17, 2025
Issue duckdb/duckdb#16250: Window Range Performance (duckdb/duckdb#16765)
shell: fix sometimes-uninitialized error (duckdb/duckdb#16761)
[Python Dev] Fix the versioning of the nightly python builds (duckdb/duckdb#16739)
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

Successfully merging this pull request may close these issues.

4 participants
0