-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fixes based on gcc 6.x warnings #4632
Conversation
hinted by gcc: ../../module/zfs/zio_inject.c: In function ‘zio_handle_io_delay’: ../../module/zfs/zio_inject.c:382:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (handler->zi_record.zi_freq != 0 && ^~ ../../module/zfs/zio_inject.c:384:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ continue; ^~~~~~~~
hinted by gcc: libzfs_import.c: In function ‘fix_paths’: libzfs_import.c:602:28: warning: self-comparison always evaluates to true [-Wtautological-compare] if (best->ne_num_labels == best->ne_num_labels && ^~
Nice finds! Thanks for opening the PR, both of these LGTM. As for the zdb issue that's going to take more investigation. I regularly build under CentOS 6.x and have never noticed these warnings. What additional flags are you including? We may want to add them them to debug builds. |
Wow, it use indent has a hint to find if without curly braces, that's a nice feature. It makes me want to go back to Arch to get the latest GCC. |
@tuxoko yes, Arch is quite nice to having (bleeding) edge tools available 👍
Arch specific options in use are:
|
I'd like to apply 6028dcd now but defer 7f231f0. This code will be replaced entirely when openzfs/openzfs@97e8130 is ported which @tonyhutter is working on at the moment. @tuxoko can I added your signed off to 6028dcd? |
Go ahead
|
Fixes bug introduced in commit 7d90f569a. Hinted by gcc: libzfs_import.c: In function ‘fix_paths’: libzfs_import.c:602:28: warning: self-comparison always evaluates to true [-Wtautological-compare] if (best->ne_num_labels == best->ne_num_labels && Signed-off-by: Marcel Huber <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue openzfs#4632
OK, I've merged both fixed from this PR rather than wait for the openzfs/openzfs@97e8130 port. |
Fixes bug introduced in commit 7d90f569a. Hinted by gcc: libzfs_import.c: In function ‘fix_paths’: libzfs_import.c:602:28: warning: self-comparison always evaluates to true [-Wtautological-compare] if (best->ne_num_labels == best->ne_num_labels && Signed-off-by: Marcel Huber <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue openzfs#4632
Fixed bug introduced in commit #c35b1882. Hinted by gcc: zio_inject.c: In function ‘zio_handle_io_delay’: zio_inject.c:382:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (handler->zi_record.zi_freq != 0 && ^~ zio_inject.c:384:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ continue; ^~~~~~~~ Signed-off-by: Marcel Huber <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#4632
Fixes bug introduced in commit 7d90f569a. Hinted by gcc: libzfs_import.c: In function ‘fix_paths’: libzfs_import.c:602:28: warning: self-comparison always evaluates to true [-Wtautological-compare] if (best->ne_num_labels == best->ne_num_labels && Signed-off-by: Marcel Huber <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue openzfs#4632
Fixes bug introduced in commit 7d90f569a. Hinted by gcc: libzfs_import.c: In function ‘fix_paths’: libzfs_import.c:602:28: warning: self-comparison always evaluates to true [-Wtautological-compare] if (best->ne_num_labels == best->ne_num_labels && Signed-off-by: Marcel Huber <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue openzfs#4632
The changes in the files should be self explanatory.
But there's another warning I was not able to fix due to fairly complicated indirections and bit manipulations. Here is the compiler output: