URL: https://github.com/SSSD/sssd/pull/5270 Author: alexey-tikhonov Title: #5270: CONFDB: fixed compilation warning Action: opened
PR body: """ Fixed following compilation warning: ``` ../src/confdb/confdb.c: In function ‘confdb_get_domains’: ../src/confdb/confdb.c:2499:12: warning: ‘enabled’ may be used uninitialized in this function [-Wmaybe-uninitialized] ``` """
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/5270/head:pr5270 git checkout pr5270
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
Label: +Waiting for review
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
sumit-bose commented: """ Hi,
I agree with the fix because currently there is imo really a chance that `enabled` is used uninitialized.
But I think `confdb_get_domain_enabled()` should get some fixes as well, at least the doc-comment which currently says
``` * @param enabled The output variable; it can not be NULL; if the * domain is explicitely enabled, *enabled is equal to 1; if the * domain is explicitely disabled, *enabled is equal to 0; any * other case, *enabled is -1. ```
should be fixes since the `enabled` parameter here is a bool and `any other case ...` does not work anymore.
If you don't want to touch `confdb_get_domain_enabled()` in this PR please open a ticket to fix it.
bye, Sumit """
See the full comment at https://github.com/SSSD/sssd/pull/5270#issuecomment-672633520
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
Label: +Changes requested
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
Label: -Waiting for review
URL: https://github.com/SSSD/sssd/pull/5270 Author: alexey-tikhonov Title: #5270: CONFDB: fixed compilation warning Action: synchronized
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/5270/head:pr5270 git checkout pr5270
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
alexey-tikhonov commented: """
I agree with the fix because currently there is imo really a chance that `enabled` is used uninitialized.
You are right. From a quick glance I thought this warning was false positive, but this seems to be a real bug. I added another patch. """
See the full comment at https://github.com/SSSD/sssd/pull/5270#issuecomment-673014706
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
Label: +Waiting for review
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
Label: -Changes requested
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
pbrezina commented: """ Maybe also remove initialization of ret to EINVAL? """
See the full comment at https://github.com/SSSD/sssd/pull/5270#issuecomment-678179875
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
alexey-tikhonov commented: """
Maybe also remove initialization of ret to EINVAL?
I agree this initialization doesn't affect anything atm, but imo it doesn't hurt anything either.
What would be the reason to remove? Do you consider it misleading? """
See the full comment at https://github.com/SSSD/sssd/pull/5270#issuecomment-678957865
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
pbrezina commented: """ If you initialize ret variable you won't catch cases where the code does not set the error but still returns it. It is a good practice. But it does not affect the code here and at least it is set to error so I leave it up to you. """
See the full comment at https://github.com/SSSD/sssd/pull/5270#issuecomment-679014463
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
sumit-bose commented: """ Hi,
thanks for the updates, ACK.
bye, Sumit """
See the full comment at https://github.com/SSSD/sssd/pull/5270#issuecomment-686965068
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
Label: -Waiting for review
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
Label: +Accepted
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
Label: +Ready to push
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
pbrezina commented: """ Pushed PR: https://github.com/SSSD/sssd/pull/5270
* `master` * fbc7082149ccc6ee4fe077480a5d692a86e75c79 - CONFDB: fixed bug in confdb_get_domain_enabled() * 83ae34509c6587568cb5164ff04d2af04da94c01 - CONFDB: fixed compilation warning
"""
See the full comment at https://github.com/SSSD/sssd/pull/5270#issuecomment-687033623
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
Label: +Pushed
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
Label: -Accepted
URL: https://github.com/SSSD/sssd/pull/5270 Title: #5270: CONFDB: fixed compilation warning
Label: -Ready to push
URL: https://github.com/SSSD/sssd/pull/5270 Author: alexey-tikhonov Title: #5270: CONFDB: fixed compilation warning Action: closed
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/5270/head:pr5270 git checkout pr5270
sssd-devel@lists.fedorahosted.org