Bug#16729109: FIX COMPILATION WARNINGS WITH GCC 4.8
Backport to 5.5 (external Bug#69407 Build warnings with mysql)
This commit is contained in:
parent
9f7043ab91
commit
a040586cce
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -391,7 +391,7 @@ C_MODE_END
|
|||||||
#define compile_time_assert(X) \
|
#define compile_time_assert(X) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
typedef char compile_time_assert[(X) ? 1 : -1]; \
|
typedef char compile_time_assert[(X) ? 1 : -1] __attribute__((unused)); \
|
||||||
} while(0)
|
} while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -69,6 +69,11 @@ TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY}
|
|||||||
${LIBNSL} ${LIBM} ${LIBRT})
|
${LIBNSL} ${LIBM} ${LIBRT})
|
||||||
DTRACE_INSTRUMENT(mysys)
|
DTRACE_INSTRUMENT(mysys)
|
||||||
|
|
||||||
|
# Need explicit pthread for gcc -fsanitize=address
|
||||||
|
IF(CMAKE_USE_PTHREADS_INIT AND CMAKE_C_FLAGS MATCHES "-fsanitize=")
|
||||||
|
TARGET_LINK_LIBRARIES(mysys pthread)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
ADD_EXECUTABLE(thr_lock thr_lock.c)
|
ADD_EXECUTABLE(thr_lock thr_lock.c)
|
||||||
TARGET_LINK_LIBRARIES(thr_lock mysys)
|
TARGET_LINK_LIBRARIES(thr_lock mysys)
|
||||||
SET_TARGET_PROPERTIES(thr_lock PROPERTIES COMPILE_FLAGS "-DMAIN")
|
SET_TARGET_PROPERTIES(thr_lock PROPERTIES COMPILE_FLAGS "-DMAIN")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
|
/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -1737,7 +1737,7 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
|
|||||||
if (action->wait_for.length())
|
if (action->wait_for.length())
|
||||||
{
|
{
|
||||||
mysql_mutex_t *old_mutex;
|
mysql_mutex_t *old_mutex;
|
||||||
mysql_cond_t *old_cond;
|
mysql_cond_t *old_cond= NULL;
|
||||||
int error= 0;
|
int error= 0;
|
||||||
struct timespec abstime;
|
struct timespec abstime;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -7380,7 +7380,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
|
|||||||
if (!String::needs_conversion(length, cs, field_charset, &dummy_offset))
|
if (!String::needs_conversion(length, cs, field_charset, &dummy_offset))
|
||||||
{
|
{
|
||||||
Field_blob::store_length(length);
|
Field_blob::store_length(length);
|
||||||
bmove(ptr+packlength,(char*) &from,sizeof(char*));
|
bmove(ptr+packlength, &from, sizeof(char*));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (tmpstr.copy(from, length, cs))
|
if (tmpstr.copy(from, length, cs))
|
||||||
@ -7897,7 +7897,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
|
|||||||
value.copy(from, length, cs);
|
value.copy(from, length, cs);
|
||||||
from= value.ptr();
|
from= value.ptr();
|
||||||
}
|
}
|
||||||
bmove(ptr + packlength, (char*) &from, sizeof(char*));
|
bmove(ptr + packlength, &from, sizeof(char*));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -33,8 +33,7 @@ ha_checksum mi_checksum(MI_INFO *info, const uchar *buf)
|
|||||||
length=_mi_calc_blob_length(rec->length-
|
length=_mi_calc_blob_length(rec->length-
|
||||||
portable_sizeof_char_ptr,
|
portable_sizeof_char_ptr,
|
||||||
buf);
|
buf);
|
||||||
memcpy((char*) &pos, buf+rec->length- portable_sizeof_char_ptr,
|
memcpy(&pos, buf+rec->length- portable_sizeof_char_ptr, sizeof(char*));
|
||||||
sizeof(char*));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FIELD_VARCHAR:
|
case FIELD_VARCHAR:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -418,7 +418,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
|
|||||||
goto err;
|
goto err;
|
||||||
#endif
|
#endif
|
||||||
memcpy(record+keyseg->start+keyseg->bit_start,
|
memcpy(record+keyseg->start+keyseg->bit_start,
|
||||||
(char*) &blob_ptr,sizeof(char*));
|
&blob_ptr,sizeof(char*));
|
||||||
memcpy(blob_ptr,key,length);
|
memcpy(blob_ptr,key,length);
|
||||||
blob_ptr+=length;
|
blob_ptr+=length;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -1051,7 +1051,7 @@ static void uf_blob(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
|
|||||||
}
|
}
|
||||||
decode_bytes(rec,bit_buff,bit_buff->blob_pos,bit_buff->blob_pos+length);
|
decode_bytes(rec,bit_buff,bit_buff->blob_pos,bit_buff->blob_pos+length);
|
||||||
_my_store_blob_length((uchar*) to,pack_length,length);
|
_my_store_blob_length((uchar*) to,pack_length,length);
|
||||||
memcpy((char*) to+pack_length, &bit_buff->blob_pos, sizeof(char*));
|
memcpy(to+pack_length, &bit_buff->blob_pos, sizeof(char*));
|
||||||
bit_buff->blob_pos+=length;
|
bit_buff->blob_pos+=length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
rm -f TAGS
|
rm -f TAGS
|
||||||
filter='\.cc$\|\.c$\|\.h$\|\.yy$'
|
filter='\.cc$\|\.c$\|\.h$\|sql_yacc\.yy$'
|
||||||
|
|
||||||
list="find . -type f"
|
list="find . -type f"
|
||||||
bzr root >/dev/null 2>/dev/null && list="bzr ls --from-root -R --kind=file --versioned"
|
bzr root >/dev/null 2>/dev/null && list="bzr ls --from-root -R --kind=file --versioned"
|
||||||
|
@ -64,7 +64,7 @@ void test_1(const char *in, const char *exp, enum_explain_filename_mode mode)
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
setup();
|
setup();
|
||||||
plan(NO_PLAN);
|
plan(22);
|
||||||
|
|
||||||
test_1("test/t1.ibd",
|
test_1("test/t1.ibd",
|
||||||
"Database \"test\", Table \"t1.ibd\"",
|
"Database \"test\", Table \"t1.ibd\"",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user