From 8da33e3a868e7ab4472823f8f3bfab3d5cd1833e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 25 Nov 2016 06:09:00 +0200 Subject: MDEV-11349 (1/2) Fix some clang 4.0 warnings In InnoDB and XtraDB functions that declare pointer parameters as nonnull, remove nullness checks, because GCC would optimize them away anyway. Use #ifdef instead of #if when checking for a configuration flag. Clang says that left shifts of negative values are undefined. So, use ~0U instead of ~0 in a number of macros. Some functions that were defined as UNIV_INLINE were declared as UNIV_INTERN. Consistently use the same type of linkage. ibuf_merge_or_delete_for_page() could pass bitmap_page=NULL to buf_page_print(), conflicting with the __attribute__((nonnull)). --- storage/xtradb/ibuf/ibuf0ibuf.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'storage/xtradb/ibuf') diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc index 13597d38433..c1d735eecdd 100644 --- a/storage/xtradb/ibuf/ibuf0ibuf.cc +++ b/storage/xtradb/ibuf/ibuf0ibuf.cc @@ -4732,8 +4732,14 @@ ibuf_merge_or_delete_for_page( bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, &mtr); - buf_page_print(bitmap_page, 0, - BUF_PAGE_PRINT_NO_CRASH); + if (bitmap_page == NULL) + { + fputs("InnoDB: cannot retrieve bitmap page\n", + stderr); + } else { + buf_page_print(bitmap_page, 0, + BUF_PAGE_PRINT_NO_CRASH); + } ibuf_mtr_commit(&mtr); fputs("\nInnoDB: Dump of the page:\n", stderr); -- cgit v1.2.1