Commit c94ccb23 authored by Tor Didriksen's avatar Tor Didriksen

Bug#16729109: FIX COMPILATION WARNINGS WITH GCC 4.8

Backport to 5.5
(external Bug#69407 Build warnings with mysql)


support-files/build-tags:
  Run etags on sql_yacc.yy, ignore other .yy files
unittest/mysys/explain_filename-t.cc:
  NO_PLAN seems to fail on some platforms, use the actual number instead.
parent d0e58676
/* /*
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 ...@@ -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
......
# 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} ...@@ -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")
/* 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) ...@@ -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;
......
/* /*
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) ...@@ -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) ...@@ -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) ...@@ -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:
......
/* 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, ...@@ -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;
......
/* 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, ...@@ -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;
} }
} }
......
#! /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) ...@@ -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\"",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment