[SSSD] [PATCHES] cache_req improvements
Jakub Hrozek
jhrozek at redhat.com
Thu Mar 12 11:30:31 UTC 2015
On Thu, Mar 12, 2015 at 11:50:21AM +0100, Jakub Hrozek wrote:
> On Thu, Mar 12, 2015 at 11:16:41AM +0100, Jakub Hrozek wrote:
> > I'm also waiting for a Coverity check to finish.
>
> There are some warnings, mostly the same problem copied around:
> Error: COMPILER_WARNING:
> sssd-1.12.90/src/responder/common/responder_cache_req.c:232:8: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
> # if (ret == EEXIST) {
> # ^
> sssd-1.12.90/src/responder/common/responder_cache_req.c:212:13: note: 'ret' was declared here
> # errno_t ret;
> # ^
>
> Error: COMPILER_WARNING:
> sssd-1.12.90/src/responder/common/responder_cache_req.c: scope_hint: In function 'cache_req_get_object'
> sssd-1.12.90/src/responder/common/responder_cache_req.c:343:8: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
> # if (ret != EOK) {
> # ^
>
> Error: COMPILER_WARNING:
> sssd-1.12.90/src/responder/common/responder_cache_req.c:348:30: warning: 'one_item_only' may be used uninitialized in this function [-Wmaybe-uninitialized]
> # } else if (one_item_only && result->count > 1) {
> # ^
>
> Error: COMPILER_WARNING:
> sssd-1.12.90/src/responder/common/responder_cache_req.c:26: included_from: Included from here.
> sssd-1.12.90/src/responder/common/responder_cache_req.c: scope_hint: In function 'cache_req_cache_done'
> sssd-1.12.90/src/util/util.h:130:9: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
> # debug_fn(__FILE__, __LINE__, __FUNCTION__, \
> # ^
> sssd-1.12.90/src/responder/common/responder_cache_req.c:243:13: note: 'ret' was declared here
> # errno_t ret;
> # ^
>
> I think it's fine to initialize ret to ERR_INTERNAL in that case. We know
> that one of the 'case' statements would hit, so this change could be just
> another precaution.
btw CI passed: http://sssd-ci.duckdns.org/logs/job/10/53/summary.html
More information about the sssd-devel
mailing list