diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2016-09-04 20:42:07 -0400 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-09-05 10:42:07 +1000 |
commit | 8af2972350d36276f101c49df37385e0c5c7624f (patch) | |
tree | f17381c2b52abd308761d82e7c9163ba95b7c306 | |
parent | ef09c29536e50f26bdf0ec33928e354e68a14288 (diff) | |
download | mongo-8af2972350d36276f101c49df37385e0c5c7624f.tar.gz |
WT-2881 Add -Wpedantic to clang compiler warning flags (#3010)
The only thing that stops us from turning on the clang -Wpedantic flag
is passing pointers of various types to printf(3) functions, using the
%p format -- cast the arguments.
-rw-r--r-- | src/btree/bt_split.c | 22 | ||||
-rw-r--r-- | src/evict/evict_lru.c | 2 | ||||
-rw-r--r-- | src/evict/evict_page.c | 2 | ||||
-rw-r--r-- | src/reconcile/rec_track.c | 6 | ||||
-rw-r--r-- | src/reconcile/rec_write.c | 5 | ||||
-rw-r--r-- | src/support/thread_group.c | 10 |
6 files changed, 27 insertions, 20 deletions
diff --git a/src/btree/bt_split.c b/src/btree/bt_split.c index 490e8aae788..48d27d696e5 100644 --- a/src/btree/bt_split.c +++ b/src/btree/bt_split.c @@ -580,7 +580,7 @@ __split_root(WT_SESSION_IMPL *session, WT_PAGE *root) __wt_verbose(session, WT_VERB_SPLIT, "%p: %" PRIu32 " root page elements, splitting into %" PRIu32 " children", - root, pindex->entries, children); + (void *)root, pindex->entries, children); /* * Allocate a new WT_PAGE_INDEX and set of WT_REF objects to be inserted @@ -891,13 +891,15 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref, WT_REF **ref_new, __wt_verbose(session, WT_VERB_SPLIT, "%p: reverse split into parent %p, %" PRIu32 " -> %" PRIu32 " (-%" PRIu32 ")", - ref->page, parent, parent_entries, result_entries, + (void *)ref->page, (void *)parent, + parent_entries, result_entries, parent_entries - result_entries); else __wt_verbose(session, WT_VERB_SPLIT, "%p: split into parent %p, %" PRIu32 " -> %" PRIu32 " (+%" PRIu32 ")", - ref->page, parent, parent_entries, result_entries, + (void *)ref->page, (void *)parent, + parent_entries, result_entries, result_entries - parent_entries); /* @@ -1063,7 +1065,7 @@ __split_internal(WT_SESSION_IMPL *session, WT_PAGE *parent, WT_PAGE *page) __wt_verbose(session, WT_VERB_SPLIT, "%p: %" PRIu32 " internal page elements, splitting %" PRIu32 " children into parent %p", - page, pindex->entries, children, parent); + (void *)page, pindex->entries, children, (void *)parent); /* * Ideally, we'd discard the original page, but that's hard since other @@ -2077,7 +2079,8 @@ __wt_split_insert(WT_SESSION_IMPL *session, WT_REF *ref) WT_PAGE *parent; bool hazard; - __wt_verbose(session, WT_VERB_SPLIT, "%p: split-insert", ref->page); + __wt_verbose( + session, WT_VERB_SPLIT, "%p: split-insert", (void *)ref->page); WT_RET(__split_internal_lock(session, ref, true, &parent, &hazard)); if ((ret = __split_insert(session, ref)) != 0) { @@ -2168,7 +2171,8 @@ __wt_split_multi(WT_SESSION_IMPL *session, WT_REF *ref, int closing) WT_PAGE *parent; bool hazard; - __wt_verbose(session, WT_VERB_SPLIT, "%p: split-multi", ref->page); + __wt_verbose( + session, WT_VERB_SPLIT, "%p: split-multi", (void *)ref->page); WT_RET(__split_internal_lock(session, ref, false, &parent, &hazard)); if ((ret = __split_multi(session, ref, closing)) != 0 || closing) { @@ -2196,7 +2200,8 @@ __wt_split_reverse(WT_SESSION_IMPL *session, WT_REF *ref) WT_PAGE *parent; bool hazard; - __wt_verbose(session, WT_VERB_SPLIT, "%p: reverse-split", ref->page); + __wt_verbose( + session, WT_VERB_SPLIT, "%p: reverse-split", (void *)ref->page); WT_RET(__split_internal_lock(session, ref, false, &parent, &hazard)); ret = __split_parent(session, ref, NULL, 0, 0, false, true); @@ -2217,7 +2222,8 @@ __wt_split_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, WT_MULTI *multi) page = ref->page; - __wt_verbose(session, WT_VERB_SPLIT, "%p: split-rewrite", ref->page); + __wt_verbose( + session, WT_VERB_SPLIT, "%p: split-rewrite", (void *)ref->page); /* * This isn't a split: a reconciliation failed because we couldn't write diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c index 83a6905707c..ede2b12c2af 100644 --- a/src/evict/evict_lru.c +++ b/src/evict/evict_lru.c @@ -1399,7 +1399,7 @@ fast: /* If the page can't be evicted, give up. */ __wt_verbose(session, WT_VERB_EVICTSERVER, "select: %p, size %" WT_SIZET_FMT, - page, page->memory_footprint); + (void *)page, page->memory_footprint); } WT_RET_NOTFOUND_OK(ret); diff --git a/src/evict/evict_page.c b/src/evict/evict_page.c index 972c72bbfb0..ab58cf0e2b5 100644 --- a/src/evict/evict_page.c +++ b/src/evict/evict_page.c @@ -117,7 +117,7 @@ __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool closing) tree_dead = F_ISSET(session->dhandle, WT_DHANDLE_DEAD); __wt_verbose(session, WT_VERB_EVICT, - "page %p (%s)", page, __wt_page_type_string(page->type)); + "page %p (%s)", (void *)page, __wt_page_type_string(page->type)); /* * Get exclusive access to the page and review it for conditions that diff --git a/src/reconcile/rec_track.c b/src/reconcile/rec_track.c index 1515550deda..ada2096a937 100644 --- a/src/reconcile/rec_track.c +++ b/src/reconcile/rec_track.c @@ -46,7 +46,7 @@ __ovfl_discard_verbose( "discard: %s%s%p %s", tag == NULL ? "" : tag, tag == NULL ? "" : ": ", - page, + (void *)page, __wt_addr_string(session, unpack->data, unpack->size, tmp)); __wt_scr_free(session, &tmp); @@ -180,7 +180,7 @@ __ovfl_reuse_verbose(WT_SESSION_IMPL *session, "reuse: %s%s%p %s (%s%s%s) {%.*s}", tag == NULL ? "" : tag, tag == NULL ? "" : ": ", - page, + (void *)page, __wt_addr_string( session, WT_OVFL_REUSE_ADDR(reuse), reuse->addr_size, tmp), F_ISSET(reuse, WT_OVFL_REUSE_INUSE) ? "inuse" : "", @@ -578,7 +578,7 @@ __ovfl_txnc_verbose(WT_SESSION_IMPL *session, "txn-cache: %s%s%p %s %" PRIu64 " {%.*s}", tag == NULL ? "" : tag, tag == NULL ? "" : ": ", - page, + (void *)page, __wt_addr_string( session, WT_OVFL_TXNC_ADDR(txnc), txnc->addr_size, tmp), txnc->current, diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c index 5990ca73cae..edfd4e0a947 100644 --- a/src/reconcile/rec_write.c +++ b/src/reconcile/rec_write.c @@ -5637,7 +5637,8 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) switch (r->bnd_next) { case 0: /* Page delete */ - __wt_verbose(session, WT_VERB_RECONCILE, "page %p empty", page); + __wt_verbose( + session, WT_VERB_RECONCILE, "page %p empty", (void *)page); WT_STAT_FAST_CONN_INCR(session, rec_page_delete); WT_STAT_FAST_DATA_INCR(session, rec_page_delete); @@ -5699,7 +5700,7 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) default: /* Page split */ __wt_verbose(session, WT_VERB_RECONCILE, "page %p reconciled into %" PRIu32 " pages", - page, r->bnd_next); + (void *)page, r->bnd_next); switch (page->type) { case WT_PAGE_COL_INT: diff --git a/src/support/thread_group.c b/src/support/thread_group.c index 0def59fa29f..f5ddabad7d4 100644 --- a/src/support/thread_group.c +++ b/src/support/thread_group.c @@ -61,7 +61,7 @@ __thread_group_grow( thread = group->threads[group->current_threads++]; __wt_verbose(session, WT_VERB_THREAD_GROUP, "Starting utility thread: %p:%"PRIu32"\n", - group, thread->id); + (void *)group, thread->id); F_SET(thread, WT_THREAD_RUN); WT_ASSERT(session, thread->session != NULL); WT_RET(__wt_thread_create(thread->session, @@ -101,7 +101,7 @@ __thread_group_shrink(WT_SESSION_IMPL *session, if (thread->tid != 0) { __wt_verbose(session, WT_VERB_THREAD_GROUP, "Stopping utility thread: %p:%"PRIu32"\n", - group, thread->id); + (void *)group, thread->id); F_CLR(thread, WT_THREAD_RUN); __wt_cond_signal(session, group->wait_cond); WT_TRET(__wt_thread_join(session, thread->tid)); @@ -225,7 +225,7 @@ __wt_thread_group_resize( __wt_verbose(session, WT_VERB_THREAD_GROUP, "Resize thread group: %p, from min: %" PRIu32 " -> %" PRIu32 " from max: %" PRIu32 " -> %" PRIu32 "\n", - group, group->min, new_min, group->max, new_max); + (void *)group, group->min, new_min, group->max, new_max); __wt_writelock(session, group->lock); WT_TRET(__thread_group_resize(session, group, new_min, new_max, flags)); @@ -253,7 +253,7 @@ __wt_thread_group_create( cond_alloced = false; __wt_verbose(session, WT_VERB_THREAD_GROUP, - "Creating thread group: %p\n", group); + "Creating thread group: %p\n", (void *)group); WT_RET(__wt_rwlock_alloc(session, &group->lock, "Thread group")); WT_ERR(__wt_cond_alloc( @@ -286,7 +286,7 @@ __wt_thread_group_destroy(WT_SESSION_IMPL *session, WT_THREAD_GROUP *group) WT_DECL_RET; __wt_verbose(session, WT_VERB_THREAD_GROUP, - "Destroying thread group: %p\n", group); + "Destroying thread group: %p\n", (void *)group); WT_ASSERT(session, __wt_rwlock_islocked(session, group->lock)); |