-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
ZOOKEEPER-3954: C client: GCC 10 compilation fixes #1486
Closed
ztzg
wants to merge
3
commits into
apache:branch-3.6
from
ztzg:ZOOKEEPER-3954-gcc10-compilation-fixes-3.6
Closed
ZOOKEEPER-3954: C client: GCC 10 compilation fixes #1486
ztzg
wants to merge
3
commits into
apache:branch-3.6
from
ztzg:ZOOKEEPER-3954-gcc10-compilation-fixes-3.6
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ining Michael Hudson-Doyle experienced an error while compiling the C client with GCC 10 and aggressive optimization settings: > `free_auth_completions` is being inlined into `free_completions`, > and this lets gcc see that members of `a_list` are being accessed > without initialization This is (fortunately!) a red herring: what GCC doesn't see is that, in practice, `zoo_lock_auth` always returns zero, and that `a_list` is always initialized in the conditional block which follows it. Let's "fix" this by removing the `if`. The rest of the client code doesn't check `zoo_lock_auth`'s return value--and we have bigger issues if unconditional locks start failing anyway.
The "unused" function causes a warning in GCC 10, which in turn causes the build to fail when '-Werror' is enabled (as in the ticket's compilation log excerpt).
The unused variable causes a warning in GCC 10, which in turn causes the build to fail when '-Werror' is enabled (as in the ticket's compilation log excerpt).
This was referenced Oct 6, 2020
symat
approved these changes
Oct 9, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
asfgit
pushed a commit
that referenced
this pull request
Oct 12, 2020
The in this PR avoids a confusing and scary compilation issue [encountered by Michael Hudson-Doyle](https://issues.apache.org/jira/browse/ZOOKEEPER-3954) when building the C client with GCC 10 and "aggressive" optimization settings: > `free_auth_completions` is being inlined into `free_completions`, and this lets gcc see that members of `a_list` are being accessed without initialization This is (fortunately!) a red herring: what GCC doesn't see is that, in practice, `zoo_lock_auth` always returns zero, and that `a_list` is always initialized in the conditional block which follows it. That issue is easily "fixed" by removing the `if`. The rest of the client code doesn't check `zoo_lock_auth`'s return value--and we have bigger issues if unconditional locks start failing anyway. See also #1481 and #1486. Author: Damien Diederen <dd@crosstwine.com> Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org> Closes #1487 from ztzg/ZOOKEEPER-3954-gcc10-compilation-fixes-master
asfgit
pushed a commit
that referenced
this pull request
Oct 12, 2020
The most important change in this PR avoids a confusing and scary compilation issue [encountered by Michael Hudson-Doyle](https://issues.apache.org/jira/browse/ZOOKEEPER-3954) when building the C client with GCC 10 and "aggressive" optimization settings: > `free_auth_completions` is being inlined into `free_completions`, and this lets gcc see that members of `a_list` are being accessed without initialization This is (fortunately!) a red herring: what GCC doesn't see is that, in practice, `zoo_lock_auth` always returns zero, and that `a_list` is always initialized in the conditional block which follows it. That issue is easily "fixed" by removing the `if`. The rest of the client code doesn't check `zoo_lock_auth`'s return value--and we have bigger issues if unconditional locks start failing anyway. The remaining changes get rid of a couple of innocuous warnings, to that the client can successfully build even when configured with `-Werror`. See also #1481. Author: Damien Diederen <dd@crosstwine.com> Reviewers: Mate Szalay-Beko <symat@apache.org> Closes #1486 from ztzg/ZOOKEEPER-3954-gcc10-compilation-fixes-3.6
RokLenarcic
pushed a commit
to RokLenarcic/zookeeper
that referenced
this pull request
Aug 31, 2022
The in this PR avoids a confusing and scary compilation issue [encountered by Michael Hudson-Doyle](https://issues.apache.org/jira/browse/ZOOKEEPER-3954) when building the C client with GCC 10 and "aggressive" optimization settings: > `free_auth_completions` is being inlined into `free_completions`, and this lets gcc see that members of `a_list` are being accessed without initialization This is (fortunately!) a red herring: what GCC doesn't see is that, in practice, `zoo_lock_auth` always returns zero, and that `a_list` is always initialized in the conditional block which follows it. That issue is easily "fixed" by removing the `if`. The rest of the client code doesn't check `zoo_lock_auth`'s return value--and we have bigger issues if unconditional locks start failing anyway. See also apache#1481 and apache#1486. Author: Damien Diederen <dd@crosstwine.com> Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org> Closes apache#1487 from ztzg/ZOOKEEPER-3954-gcc10-compilation-fixes-master
RokLenarcic
pushed a commit
to RokLenarcic/zookeeper
that referenced
this pull request
Aug 31, 2022
The in this PR avoids a confusing and scary compilation issue [encountered by Michael Hudson-Doyle](https://issues.apache.org/jira/browse/ZOOKEEPER-3954) when building the C client with GCC 10 and "aggressive" optimization settings: > `free_auth_completions` is being inlined into `free_completions`, and this lets gcc see that members of `a_list` are being accessed without initialization This is (fortunately!) a red herring: what GCC doesn't see is that, in practice, `zoo_lock_auth` always returns zero, and that `a_list` is always initialized in the conditional block which follows it. That issue is easily "fixed" by removing the `if`. The rest of the client code doesn't check `zoo_lock_auth`'s return value--and we have bigger issues if unconditional locks start failing anyway. See also apache#1481 and apache#1486. Author: Damien Diederen <dd@crosstwine.com> Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org> Closes apache#1487 from ztzg/ZOOKEEPER-3954-gcc10-compilation-fixes-master
RokLenarcic
pushed a commit
to RokLenarcic/zookeeper
that referenced
this pull request
Aug 31, 2022
The in this PR avoids a confusing and scary compilation issue [encountered by Michael Hudson-Doyle](https://issues.apache.org/jira/browse/ZOOKEEPER-3954) when building the C client with GCC 10 and "aggressive" optimization settings: > `free_auth_completions` is being inlined into `free_completions`, and this lets gcc see that members of `a_list` are being accessed without initialization This is (fortunately!) a red herring: what GCC doesn't see is that, in practice, `zoo_lock_auth` always returns zero, and that `a_list` is always initialized in the conditional block which follows it. That issue is easily "fixed" by removing the `if`. The rest of the client code doesn't check `zoo_lock_auth`'s return value--and we have bigger issues if unconditional locks start failing anyway. See also apache#1481 and apache#1486. Author: Damien Diederen <dd@crosstwine.com> Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org> Closes apache#1487 from ztzg/ZOOKEEPER-3954-gcc10-compilation-fixes-master
RokLenarcic
pushed a commit
to RokLenarcic/zookeeper
that referenced
this pull request
Sep 3, 2022
The in this PR avoids a confusing and scary compilation issue [encountered by Michael Hudson-Doyle](https://issues.apache.org/jira/browse/ZOOKEEPER-3954) when building the C client with GCC 10 and "aggressive" optimization settings: > `free_auth_completions` is being inlined into `free_completions`, and this lets gcc see that members of `a_list` are being accessed without initialization This is (fortunately!) a red herring: what GCC doesn't see is that, in practice, `zoo_lock_auth` always returns zero, and that `a_list` is always initialized in the conditional block which follows it. That issue is easily "fixed" by removing the `if`. The rest of the client code doesn't check `zoo_lock_auth`'s return value--and we have bigger issues if unconditional locks start failing anyway. See also apache#1481 and apache#1486. Author: Damien Diederen <dd@crosstwine.com> Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org> Closes apache#1487 from ztzg/ZOOKEEPER-3954-gcc10-compilation-fixes-master
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The most important change in this PR avoids a confusing and scary compilation issue encountered by Michael Hudson-Doyle when building the C client with GCC 10 and "aggressive" optimization settings:
This is (fortunately!) a red herring: what GCC doesn't see is that, in practice,
zoo_lock_auth
always returns zero, and thata_list
is always initialized in the conditional block which follows it.That issue is easily "fixed" by removing the
if
. The rest of the client code doesn't checkzoo_lock_auth
's return value--and we have bigger issues if unconditional locks start failing anyway.The remaining changes get rid of a couple of innocuous warnings, to that the client can successfully build even when configured with
-Werror
.See also #1481.