From f0fd1b00685943104893d9676d904137edd250f6 Mon Sep 17 00:00:00 2001 From: Gunnar Kudrjavets Date: Thu, 17 Mar 2016 11:07:51 -0700 Subject: [PATCH] Remove the usage of returns_nonnull to make sure that we'll compile with gcc 4.8.x again Summary: The issue was exposed by https://github.com/facebook/mysql-5.6/issues/207. The root cause is the fact that gcc 4.8.x doesn't implement a support for `returns_nonnull`. Take a look at https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Function-Attributes.html vs. https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Function-Attributes.html. For last couple of months we've been operating under the assumption that gcc 4.9.x is the lowest supported platform. We need to go back and internally either revisit this decision or be very explicit about our dependency requirements. Test Plan: Optimistic fix, needs to be really verified on the system running gcc 4.8.x. ``` mysqlbuild.sh ``` Reviewers: yoshinorim, MarkCallaghan Reviewed By: MarkCallaghan Subscribers: webscalesql-eng Differential Revision: https://reviews.facebook.net/D55641 (cherry picked from commit 76887a20b4534bd60068ae2cf0394b0286f3192f) --- storage/rocksdb/ha_rocksdb.h | 1 - storage/rocksdb/ha_rocksdb_proto.h | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index f6f9358b22a8..d9188debbdc2 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -596,7 +596,6 @@ class ha_rocksdb: public handler ulong index_flags(uint inx, uint part, bool all_parts) const; const key_map * keys_to_use_for_scanning() - __attribute__((__returns_nonnull__)) { return &key_map_full; } diff --git a/storage/rocksdb/ha_rocksdb_proto.h b/storage/rocksdb/ha_rocksdb_proto.h index cf6cda597611..b5f1e2ec0afc 100644 --- a/storage/rocksdb/ha_rocksdb_proto.h +++ b/storage/rocksdb/ha_rocksdb_proto.h @@ -46,15 +46,15 @@ void request_save_stats(); class Dict_manager; Dict_manager *get_dict_manager(void) - __attribute__((__returns_nonnull__, __warn_unused_result__)); + __attribute__((__warn_unused_result__)); class Table_ddl_manager; Table_ddl_manager *get_ddl_manager(void) - __attribute__((__returns_nonnull__, __warn_unused_result__)); + __attribute__((__warn_unused_result__)); class Binlog_info_manager; Binlog_info_manager *get_binlog_manager(void) - __attribute__((__returns_nonnull__, __warn_unused_result__)); + __attribute__((__warn_unused_result__)); } // namespace myrocks