[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: 1.10 task: error leaks

From: Julian Foad <julianfoad_at_apache.org>
Date: Fri, 15 Dec 2017 17:51:07 +0000

Daniel Shahaf wrote:
> The release branch creation checkpoints calls for checking for error
> leaks, so here's the output of tools/dev/warn-unused-result.sh
[...]
> ...: warning: 'warn_unused_result' attribute only applies to functions, methods, and classes [-Wignored-attributes]

This kind of warning is when the script inappropriately puts the
attribute on a variable declaration, so we can ignore these.

> subversion/libsvn_subr/stream.c:1471:9:
> svn_checksum_ctx_reset(btn->read_ctx);
> subversion/libsvn_subr/stream.c:1474:9:
> svn_checksum_ctx_reset(btn->write_ctx);

These are the only two callers of this new-for-1.10 API:

/**
  * Reset an existing checksum @a ctx to initial state.
  * @see svn_checksum_ctx_create()
  *
  * @since New in 1.10.
  */
svn_error_t *
svn_checksum_ctx_reset(svn_checksum_ctx_t *ctx);

One possible solution would be to drop the error return.

I have taken the more conservative option of adding SVN_ERR() around the
calls, in r1818307.

> subversion/libsvn_client/patch.c:2148:7:
> svn_stream_printf(target->reject_stream,

r1818309.

> subversion/libsvn_fs_fs/low_level.c:673:5:
> svn_stream_puts(stream, "\n");
> subversion/libsvn_fs_x/changes.c:187:5:
> append_change(changes, APR_ARRAY_IDX(list, i, svn_fs_x__change_t *));
> subversion/libsvn_fs_x/low_level.c:1134:5:
> svn_stream_puts(stream, "\n");
> subversion/libsvn_fs_x/transaction.c:1262:11:
> svn_io_dir_make(txn_dir, APR_OS_DEFAULT, iterpool);
> subversion/libsvn_wc/wc_db.c:16528:15:
> lock_remove_txn(queue->wcroot, cqi->local_relpath, work_item,
> subversion/svn/conflict-callbacks.c:1657:11:
> svn_cmdline_fprintf(stderr, iterpool, "%s\n",
> subversion/svn/notify.c:213:3:
> svn_hash_keys(conflicted_paths, all_conflicts, result_pool);
> subversion/svnfsfs/load-index-cmd.c:150:7:
> svn_stream_readline(input, &line, "\n", &eol, iterpool);

r1818310.

> subversion/tests/libsvn_repos/authz-test.c:280:5:
> print_user_rights(NULL, NULL, 0, &authz->anon_rights, pool);
> subversion/tests/libsvn_repos/authz-test.c:282:5:
> print_user_rights(NULL, NULL, 0, &authz->authn_rights, pool);
> subversion/tests/libsvn_client/conflicts-test.c:543:7:
> sbox_wc_move(b, move_src_path, new_dir_path);
> subversion/tests/libsvn_repos/dump-load-test.c:84:3:
> svn_stream_close(stream);
> subversion/tests/libsvn_repos/dump-load-test.c:134:3:
> svn_stream_close(stream);
> subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c:1634:3:
> svn_hash_write2(props, svn_stream_from_stringbuf(hash_rep, pool), "END",
> subversion/tests/libsvn_subr/mergeinfo-test.c:1765:6:
> svn_rangelist_to_string(&tmp_string, rangelist, pool);
> subversion/tests/libsvn_subr/priority-queue-test.c:128:3:
> verify_empty_queue(queue);
> subversion/tests/libsvn_subr/priority-queue-test.c:157:3:
> verify_empty_queue(queue);
> subversion/tests/libsvn_subr/priority-queue-test.c:217:3:
> verify_empty_queue(queue);
> tools/client-side/svnconflict/svnconflict.c:366:5:
> svn_cmdline_printf(pool, "text-conflict\n");
> tools/client-side/svnconflict/svnconflict.c:371:7:
> svn_cmdline_printf(pool, "prop-conflict: %s\n", propname);
> tools/client-side/svnconflict/svnconflict.c:383:7:
> svn_cmdline_printf(pool, "tree-conflict: %s %s\n",
> tools/client-side/svnconflict/svnconflict.c:404:7:
> svn_cmdline_printf(pool, "%d: %s\n", id, label);
> tools/dev/svnmover/svnmover.c:2439:5: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result]
> svn_stringbuf_from_stream(&text, src, 0, scratch_pool);

Still to do.

- Julian
Received on 2017-12-15 18:51:12 CET

This is an archived mail posted to the Subversion Dev mailing list.