Skip to content
Permalink
Browse files

MDEV-10725 Server 10.1.17 fails to build using clang with c++11

my_offsetof() returns a difference of two pointers, it must use the
appropriate return type (my_ptrdiff_t, not size_t)
  • Loading branch information...
vuvova committed Sep 23, 2016
1 parent 9434431 commit f620da194befe4506679ad7f1d0725796fad7de0
Showing with 4 additions and 5 deletions.
  1. +1 −2 include/my_global.h
  2. +3 −3 sql/parse_file.h
@@ -857,8 +857,7 @@ typedef long long my_ptrdiff_t;
and related routines are refactored.
*/

#define my_offsetof(TYPE, MEMBER) \
((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
#define my_offsetof(TYPE, MEMBER) PTR_BYTE_DIFF(&((TYPE *)0x10)->MEMBER, 0x10)

#define NullS (char *) 0

@@ -42,9 +42,9 @@ enum file_opt_type {

struct File_option
{
LEX_STRING name; /**< Name of the option */
int offset; /**< offset to base address of value */
file_opt_type type; /**< Option type */
LEX_STRING name; /**< Name of the option */
my_ptrdiff_t offset; /**< offset to base address of value */
file_opt_type type; /**< Option type */
};


0 comments on commit f620da1

Please sign in to comment.
You can’t perform that action at this time.