From 3e9c52250a3ab6664c53ea6b3923acfbe8e09e4e Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 20 Oct 2010 16:21:40 -0200 Subject: Bug#45288: pb2 returns a lot of compilation warnings Fix assorted warnings that are generated in optimized builds. Most of it is silencing variables that are set but unused. This patch also introduces the MY_ASSERT_UNREACHABLE macro which helps the compiler to deduce that a certain piece of code is unreachable. include/my_compiler.h: Use GCC's __builtin_unreachable if available. It allows GCC to deduce the unreachability of certain code paths, thus avoiding warnings that, for example, accused that a variable could be used without being initialized (due to unreachable code paths). --- sql/sql_partition.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_partition.cc') diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 76caa2b0c8d..702c3d99fda 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -6786,8 +6786,8 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info, } } else - assert(0); - + MY_ASSERT_UNREACHABLE(); + can_match_multiple_values= (flags || !min_value || !max_value || memcmp(min_value, max_value, field_len)); if (can_match_multiple_values && -- cgit v1.2.1