There are some compiler warnings in trunk:
[[[
subversion/libsvn_client/conflicts.c:3846:12: warning: variable 'action' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
else if (conflict_operation == svn_wc_operation_merge)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subversion/libsvn_client/conflicts.c:3868:59: note: uninitialized use occurs here
*incoming_change_description = apr_pstrdup(result_pool, action);
^~~~~~
subversion/libsvn_client/conflicts.c:3846:8: note: remove the 'if' if its condition is always true
else if (conflict_operation == svn_wc_operation_merge)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subversion/libsvn_client/conflicts.c:3781:21: note: initialize the variable 'action' to silence this warning
const char *action;
^
= NULL
subversion/libsvn_client/conflicts.c:4858:12: warning: variable 'action' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
else if (conflict_operation == svn_wc_operation_merge)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subversion/libsvn_client/conflicts.c:4873:59: note: uninitialized use occurs here
*incoming_change_description = apr_pstrdup(result_pool, action);
^~~~~~
subversion/libsvn_client/conflicts.c:4858:8: note: remove the 'if' if its condition is always true
else if (conflict_operation == svn_wc_operation_merge)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subversion/libsvn_client/conflicts.c:4815:21: note: initialize the variable 'action' to silence this warning
const char *action;
^
= NULL
subversion/libsvn_client/conflicts.c:5052:12: warning: variable 'url' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
else if (operation == svn_wc_operation_switch ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subversion/libsvn_client/conflicts.c:5064:48: note: uninitialized use occurs here
url, NULL, NULL,
^~~
subversion/include/svn_error.h:353:35: note: expanded from macro 'SVN_ERR'
svn_error_t *svn_err__temp = (expr); \
^
subversion/libsvn_client/conflicts.c:5052:8: note: remove the 'if' if its condition is always true
else if (operation == svn_wc_operation_switch ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subversion/libsvn_client/conflicts.c:5019:18: note: initialize the variable 'url' to silence this warning
const char *url;
^
= NULL
subversion/libsvn_client/conflicts.c:5284:12: warning: variable 'action' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
else if (conflict_operation == svn_wc_operation_merge)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subversion/libsvn_client/conflicts.c:5392:50: note: uninitialized use occurs here
action = apr_psprintf(scratch_pool, "%s:\n%s", action,
^~~~~~
subversion/libsvn_client/conflicts.c:5284:8: note: remove the 'if' if its condition is always true
else if (conflict_operation == svn_wc_operation_merge)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subversion/libsvn_client/conflicts.c:5251:21: note: initialize the variable 'action' to silence this warning
const char *action;
^
= NULL
4 warnings generated.
]]]
I spot checked a few and they look valid, e.g., the 'url' one will cause
undefined behaviour (dereferencing an uninitialised pointer) if neither 'if'
branch is taken.
I assume most of these should either add an «else SVN_ERR_MALFUNCTION();»
branch, or initialise to NULL.
Cheers,
Daniel
Received on 2017-06-29 05:02:59 CEST