diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2017-03-23 21:16:42 -0400 |
---|---|---|
committer | Sulabh Mahajan <sulabh.mahajan@mongodb.com> | 2017-03-24 12:16:42 +1100 |
commit | 81df9eadd01427173e7b14525f53723a33a7235e (patch) | |
tree | 6724b247dfec2e30d29274395e9db88ad3e32f20 | |
parent | 6bd63027a6fd00db3f0f379acb929c22cd1b7f6f (diff) | |
download | mongo-81df9eadd01427173e7b14525f53723a33a7235e.tar.gz |
WT-3234 Update WiredTiger build for clang 4.0. (#3345)
* Update WiredTiger build for clang 4.0.
ex_all.c:852:7: error: possible misuse of comma operator here [-Werror,-Wcomma]
p1++, p2++;
^
ex_all.c:852:3: note: cast expression to void to silence warning
p1++, p2++;
^~~~
(void)( )
1 error generated.
* wtperf.c:2670:4: error: code will never be executed [-Werror,-Wunreachable-code]
pos += (size_t)snprintf(
^~~
wtperf.c:2669:23: note: silence by adding parentheses to mark code as explicitly dead
if (opts->verbose > 1 && strlen(debug_tconfig) != 0)
^
/* DISABLES CODE */ ( )
wtperf.c:2630:4: error: code will never be executed [-Werror,-Wunreachable-code]
pos += (size_t)snprintf(
^~~
wtperf.c:2629:23: note: silence by adding parentheses to mark code as explicitly dead
if (opts->verbose > 1 && strlen(debug_cconfig) != 0)
^
/* DISABLES CODE */ ( )
2 errors generated.
-rw-r--r-- | bench/wtperf/wtperf.c | 18 | ||||
-rw-r--r-- | examples/c/ex_all.c | 4 |
2 files changed, 4 insertions, 18 deletions
diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c index b5aff21bdbc..772dedac8c8 100644 --- a/bench/wtperf/wtperf.c +++ b/bench/wtperf/wtperf.c @@ -32,9 +32,6 @@ #define DEFAULT_HOME "WT_TEST" #define DEFAULT_MONITOR_DIR "WT_TEST" -static const char * const debug_cconfig = ""; -static const char * const debug_tconfig = ""; - static void *checkpoint_worker(void *); static int drop_all_tables(WTPERF *); static int execute_populate(WTPERF *); @@ -2569,8 +2566,7 @@ main(int argc, char *argv[]) __wt_stream_set_line_buffer(stdout); /* Concatenate non-default configuration strings. */ - if ((opts->verbose > 1 && strlen(debug_cconfig) != 0) || - user_cconfig != NULL || opts->session_count_idle > 0 || + if (user_cconfig != NULL || opts->session_count_idle > 0 || wtperf->compress_ext != NULL || wtperf->async_config != NULL || opts->in_memory) { req_len = 20; @@ -2589,7 +2585,6 @@ main(int argc, char *argv[]) } req_len += opts->in_memory ? strlen("in_memory=true") : 0; req_len += user_cconfig != NULL ? strlen(user_cconfig) : 0; - req_len += debug_cconfig != NULL ? strlen(debug_cconfig) : 0; cc_buf = dmalloc(req_len); pos = 0; @@ -2626,23 +2621,18 @@ main(int argc, char *argv[]) append_comma, user_cconfig); append_comma = ","; } - if (opts->verbose > 1 && strlen(debug_cconfig) != 0) - pos += (size_t)snprintf( - cc_buf + pos, req_len - pos, "%s%s", - append_comma, debug_cconfig); if (strlen(cc_buf) != 0 && (ret = config_opt_name_value(wtperf, "conn_config", cc_buf)) != 0) goto err; } - if ((opts->verbose > 1 && strlen(debug_tconfig) != 0) || opts->index || + if (opts->index || user_tconfig != NULL || wtperf->compress_table != NULL) { req_len = 20; req_len += wtperf->compress_table != NULL ? strlen(wtperf->compress_table) : 0; req_len += opts->index ? strlen(INDEX_COL_NAMES) : 0; req_len += user_tconfig != NULL ? strlen(user_tconfig) : 0; - req_len += debug_tconfig != NULL ? strlen(debug_tconfig) : 0; tc_buf = dmalloc(req_len); pos = 0; @@ -2666,10 +2656,6 @@ main(int argc, char *argv[]) append_comma, user_tconfig); append_comma = ","; } - if (opts->verbose > 1 && strlen(debug_tconfig) != 0) - pos += (size_t)snprintf( - tc_buf + pos, req_len - pos, "%s%s", - append_comma, debug_tconfig); if (strlen(tc_buf) != 0 && (ret = config_opt_name_value(wtperf, "table_config", tc_buf)) != 0) diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c index 8a1533011b2..82620673fe1 100644 --- a/examples/c/ex_all.c +++ b/examples/c/ex_all.c @@ -848,8 +848,8 @@ my_compare(WT_COLLATOR *collator, WT_SESSION *session, p1 = (const char *)value1->data; p2 = (const char *)value2->data; - while (*p1 != '\0' && *p1 == *p2) - p1++, p2++; + for (; *p1 != '\0' && *p1 == *p2; ++p1, ++p2) + ; *cmp = (int)*p2 - (int)*p1; return (0); |