summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/mysqlbinlog.cc4
-rw-r--r--config/ac-macros/misc.m46
-rw-r--r--extra/yassl/include/yassl_int.hpp2
-rw-r--r--extra/yassl/src/handshake.cpp6
-rw-r--r--extra/yassl/src/yassl_imp.cpp3
-rw-r--r--extra/yassl/src/yassl_int.cpp2
-rw-r--r--extra/yassl/taocrypt/include/modes.hpp3
-rw-r--r--extra/yassl/taocrypt/src/asn.cpp9
-rw-r--r--mysys/my_compress.c5
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/strfunc.cc2
-rw-r--r--storage/pbxt/src/discover_xt.cc6
-rw-r--r--storage/xtradb/fil/fil0fil.c4
-rw-r--r--storage/xtradb/mtr/mtr0mtr.c1
-rw-r--r--storage/xtradb/srv/srv0srv.c1
-rw-r--r--storage/xtradb/srv/srv0start.c14
-rw-r--r--strings/decimal.c6
-rw-r--r--support-files/ccfilter104
-rw-r--r--support-files/compiler_warnings.supp20
19 files changed, 161 insertions, 39 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 1621db5ded8..5ebf6768872 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -689,8 +689,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
Format events are not concerned by --offset and such, we always need to
read them to be able to process the wanted events.
*/
- if ((rec_count >= offset) &&
- ((my_time_t)(ev->when) >= start_datetime) ||
+ if (((rec_count >= offset) &&
+ ((my_time_t)(ev->when) >= start_datetime)) ||
(ev_type == FORMAT_DESCRIPTION_EVENT))
{
if (ev_type != FORMAT_DESCRIPTION_EVENT)
diff --git a/config/ac-macros/misc.m4 b/config/ac-macros/misc.m4
index 2fbb30383bd..7ada1cc7615 100644
--- a/config/ac-macros/misc.m4
+++ b/config/ac-macros/misc.m4
@@ -594,15 +594,15 @@ dnl ---------------------------------------------------------------------------
dnl MYSQL_NEEDS_MYSYS_NEW
AC_DEFUN([MYSQL_NEEDS_MYSYS_NEW],
-[AC_CACHE_CHECK([needs mysys_new helpers], mysql_use_mysys_new,
+[AC_CACHE_CHECK([needs mysys_new helpers], mysql_cv_use_mysys_new,
[
AC_LANG_PUSH(C++)
AC_TRY_LINK([], [
class A { public: int b; }; A *a=new A; a->b=10; delete a;
-], mysql_use_mysys_new=no, mysql_use_mysys_new=yes)
+], mysql_cv_use_mysys_new=no, mysql_cv_use_mysys_new=yes)
AC_LANG_POP(C++)
])
-if test "$mysql_use_mysys_new" = "yes"
+if test "$mysql_cv_use_mysys_new" = "yes"
then
AC_DEFINE([USE_MYSYS_NEW], [1], [Needs to use mysys_new helpers])
fi
diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp
index d18dc41860c..12489468e6b 100644
--- a/extra/yassl/include/yassl_int.hpp
+++ b/extra/yassl/include/yassl_int.hpp
@@ -441,7 +441,7 @@ public:
const Ciphers& GetCiphers() const;
const DH_Parms& GetDH_Parms() const;
const Stats& GetStats() const;
- const VerifyCallback getVerifyCallback() const;
+ VerifyCallback getVerifyCallback() const;
pem_password_cb GetPasswordCb() const;
void* GetUserData() const;
bool GetSessionCacheOff() const;
diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp
index 262b5cb3b8b..a95fa5df4f8 100644
--- a/extra/yassl/src/handshake.cpp
+++ b/extra/yassl/src/handshake.cpp
@@ -789,7 +789,7 @@ void processReply(SSL& ssl)
{
if (ssl.GetError()) return;
- if (DoProcessReply(ssl))
+ if (DoProcessReply(ssl)) {
// didn't complete process
if (!ssl.getSocket().IsNonBlocking()) {
// keep trying now, blocking ok
@@ -799,6 +799,7 @@ void processReply(SSL& ssl)
else
// user will have try again later, non blocking
ssl.SetError(YasslError(SSL_ERROR_WANT_READ));
+ }
}
@@ -872,11 +873,12 @@ void sendServerKeyExchange(SSL& ssl, BufferOutput buffer)
// send change cipher
void sendChangeCipher(SSL& ssl, BufferOutput buffer)
{
- if (ssl.getSecurity().get_parms().entity_ == server_end)
+ if (ssl.getSecurity().get_parms().entity_ == server_end) {
if (ssl.getSecurity().get_resuming())
ssl.verifyState(clientKeyExchangeComplete);
else
ssl.verifyState(clientFinishedComplete);
+ }
if (ssl.GetError()) return;
ChangeCipherSpec ccs;
diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp
index 20dfe50f132..d0eabce7bc9 100644
--- a/extra/yassl/src/yassl_imp.cpp
+++ b/extra/yassl/src/yassl_imp.cpp
@@ -1304,7 +1304,7 @@ void ServerHello::Process(input_buffer&, SSL& ssl)
else
ssl.useSecurity().use_connection().sessionID_Set_ = false;
- if (ssl.getSecurity().get_resuming())
+ if (ssl.getSecurity().get_resuming()) {
if (memcmp(session_id_, ssl.getSecurity().get_resume().GetID(),
ID_LEN) == 0) {
ssl.set_masterSecret(ssl.getSecurity().get_resume().GetSecret());
@@ -1319,6 +1319,7 @@ void ServerHello::Process(input_buffer&, SSL& ssl)
ssl.useSecurity().set_resuming(false);
ssl.useLog().Trace("server denied resumption");
}
+ }
if (ssl.CompressionOn() && !compression_method_)
ssl.UnSetCompression(); // server isn't supporting yaSSL zlib request
diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp
index b7f91d72166..8e4a9aa95ec 100644
--- a/extra/yassl/src/yassl_int.cpp
+++ b/extra/yassl/src/yassl_int.cpp
@@ -1833,7 +1833,7 @@ SSL_CTX::GetCA_List() const
}
-const VerifyCallback SSL_CTX::getVerifyCallback() const
+VerifyCallback SSL_CTX::getVerifyCallback() const
{
return verifyCallback_;
}
diff --git a/extra/yassl/taocrypt/include/modes.hpp b/extra/yassl/taocrypt/include/modes.hpp
index d1ebce7568b..9846527d116 100644
--- a/extra/yassl/taocrypt/include/modes.hpp
+++ b/extra/yassl/taocrypt/include/modes.hpp
@@ -95,11 +95,12 @@ inline void Mode_BASE::Process(byte* out, const byte* in, word32 sz)
{
if (mode_ == ECB)
ECB_Process(out, in, sz);
- else if (mode_ == CBC)
+ else if (mode_ == CBC) {
if (dir_ == ENCRYPTION)
CBC_Encrypt(out, in, sz);
else
CBC_Decrypt(out, in, sz);
+ }
}
diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp
index 3b1c1c2136a..0e95ecd885f 100644
--- a/extra/yassl/taocrypt/src/asn.cpp
+++ b/extra/yassl/taocrypt/src/asn.cpp
@@ -780,11 +780,12 @@ void CertDecoder::GetDate(DateType dt)
memcpy(date, source_.get_current(), length);
source_.advance(length);
- if (!ValidateDate(date, b, dt) && verify_)
+ if (!ValidateDate(date, b, dt) && verify_) {
if (dt == BEFORE)
source_.SetError(BEFORE_DATE_E);
else
source_.SetError(AFTER_DATE_E);
+ }
// save for later use
if (dt == BEFORE) {
@@ -1061,7 +1062,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
return 0;
}
word32 rLen = GetLength(source);
- if (rLen != 20)
+ if (rLen != 20) {
if (rLen == 21) { // zero at front, eat
source.next();
--rLen;
@@ -1074,6 +1075,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
source.SetError(DSA_SZ_E);
return 0;
}
+ }
memcpy(decoded, source.get_buffer() + source.get_index(), rLen);
source.advance(rLen);
@@ -1083,7 +1085,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
return 0;
}
word32 sLen = GetLength(source);
- if (sLen != 20)
+ if (sLen != 20) {
if (sLen == 21) {
source.next(); // zero at front, eat
--sLen;
@@ -1096,6 +1098,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
source.SetError(DSA_SZ_E);
return 0;
}
+ }
memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen);
source.advance(sLen);
diff --git a/mysys/my_compress.c b/mysys/my_compress.c
index 26626d70079..ade2742c4fc 100644
--- a/mysys/my_compress.c
+++ b/mysys/my_compress.c
@@ -81,12 +81,13 @@ my_bool my_compress(uchar *packet, size_t *len, size_t *complen)
This fix is safe, since such memory is only used internally by zlib, so we
will not hide any bugs in mysql this way.
*/
-void *my_az_allocator(void *dummy, unsigned int items, unsigned int size)
+void *my_az_allocator(void *dummy __attribute__((unused)), unsigned int items,
+ unsigned int size)
{
return my_malloc((size_t)items*(size_t)size, IF_VALGRIND(MY_ZEROFILL, MYF(0)));
}
-void my_az_free(void *dummy, void *address)
+void my_az_free(void *dummy __attribute__((unused)), void *address)
{
my_free(address, MYF(MY_ALLOW_ZERO_PTR));
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 4a5a207ca1c..fc757443b5a 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1002,6 +1002,7 @@ static void close_connections(void)
}
+#ifdef HAVE_CLOSE_SERVER_SOCK
static void close_socket(my_socket sock, const char *info)
{
DBUG_ENTER("close_socket");
@@ -1021,6 +1022,7 @@ static void close_socket(my_socket sock, const char *info)
}
DBUG_VOID_RETURN;
}
+#endif
static void close_server_sock()
diff --git a/sql/strfunc.cc b/sql/strfunc.cc
index 5ff2efe2020..4a3d7527510 100644
--- a/sql/strfunc.cc
+++ b/sql/strfunc.cc
@@ -148,7 +148,7 @@ static uint parse_name(TYPELIB *lib, const char **strpos, const char *end,
}
}
else
- for (; pos != end && *pos != '=' && *pos !=',' ; pos++);
+ for (; pos != end && *pos != '=' && *pos !=',' ; pos++) {}
uint var_len= (uint) (pos - start);
/* Determine which flag it is */
diff --git a/storage/pbxt/src/discover_xt.cc b/storage/pbxt/src/discover_xt.cc
index fb325d78f7f..1bb6e874a1c 100644
--- a/storage/pbxt/src/discover_xt.cc
+++ b/storage/pbxt/src/discover_xt.cc
@@ -493,8 +493,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
}
/* Don't pack rows in old tables if the user has requested this */
if ((sql_field->flags & BLOB_FLAG) ||
- sql_field->sql_type == MYSQL_TYPE_VARCHAR &&
- create_info->row_type != ROW_TYPE_FIXED)
+ (sql_field->sql_type == MYSQL_TYPE_VARCHAR &&
+ create_info->row_type != ROW_TYPE_FIXED))
(*db_options)|= HA_OPTION_PACK_RECORD;
it2.rewind();
}
@@ -963,7 +963,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
sql_field->sql_type == MYSQL_TYPE_VARCHAR ||
sql_field->pack_flag & FIELDFLAG_BLOB)))
{
- if (column_nr == 0 && (sql_field->pack_flag & FIELDFLAG_BLOB) ||
+ if ((column_nr == 0 && (sql_field->pack_flag & FIELDFLAG_BLOB)) ||
sql_field->sql_type == MYSQL_TYPE_VARCHAR)
key_info->flags|= HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY;
else
diff --git a/storage/xtradb/fil/fil0fil.c b/storage/xtradb/fil/fil0fil.c
index 2bf677c9398..c60136e27c0 100644
--- a/storage/xtradb/fil/fil0fil.c
+++ b/storage/xtradb/fil/fil0fil.c
@@ -45,7 +45,9 @@ Created 10/25/1995 Heikki Tuuri
#include "trx0trx.h"
#include "trx0sys.h"
#include "pars0pars.h"
+#include "row0row.h"
#include "row0mysql.h"
+#include "que0que.h"
/*
@@ -3137,7 +3139,7 @@ skip_info:
rec_offs_init(offsets_);
- fprintf(stderr, "InnoDB: Progress in %:");
+ fprintf(stderr, "%s", "InnoDB: Progress in %:");
for (offset = 0; offset < size_bytes; offset += UNIV_PAGE_SIZE) {
success = os_file_read(file, page,
diff --git a/storage/xtradb/mtr/mtr0mtr.c b/storage/xtradb/mtr/mtr0mtr.c
index 703f9b18eed..1f811a6eea3 100644
--- a/storage/xtradb/mtr/mtr0mtr.c
+++ b/storage/xtradb/mtr/mtr0mtr.c
@@ -32,6 +32,7 @@ Created 11/26/1995 Heikki Tuuri
#include "page0types.h"
#include "mtr0log.h"
#include "log0log.h"
+#include "buf0flu.h"
/*********************************************************************
Releases the item in the slot given. */
diff --git a/storage/xtradb/srv/srv0srv.c b/storage/xtradb/srv/srv0srv.c
index 17a36996c7d..2f349fad0fa 100644
--- a/storage/xtradb/srv/srv0srv.c
+++ b/storage/xtradb/srv/srv0srv.c
@@ -1815,7 +1815,6 @@ srv_printf_innodb_monitor(
ulint btr_search_sys_subtotal;
ulint lock_sys_subtotal;
ulint recv_sys_subtotal;
- ulint io_counter_subtotal;
ulint i;
trx_t* trx;
diff --git a/storage/xtradb/srv/srv0start.c b/storage/xtradb/srv/srv0start.c
index 9239af0cad5..7140b59964d 100644
--- a/storage/xtradb/srv/srv0start.c
+++ b/storage/xtradb/srv/srv0start.c
@@ -122,20 +122,6 @@ static char* srv_monitor_file_name;
#define SRV_MAX_N_PENDING_SYNC_IOS 100
-/* Avoid warnings when using purify */
-
-#ifdef HAVE_valgrind
-static int inno_bcmp(register const char *s1, register const char *s2,
- register uint len)
-{
- while ((len-- != 0) && (*s1++ == *s2++))
- ;
-
- return(len + 1);
-}
-#define memcmp(A,B,C) inno_bcmp((A),(B),(C))
-#endif
-
static
char*
srv_parse_megabytes(
diff --git a/strings/decimal.c b/strings/decimal.c
index d8380839889..2d257d9af70 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -306,7 +306,7 @@ int decimal_actual_fraction(decimal_t *from)
{
for (i= DIG_PER_DEC1 - ((frac - 1) % DIG_PER_DEC1);
*buf0 % powers10[i++] == 0;
- frac--);
+ frac--) {}
}
return frac;
}
@@ -500,7 +500,7 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result)
stop= (int) ((buf_end - from->buf + 1) * DIG_PER_DEC1);
i= 1;
}
- for (; *buf_end % powers10[i++] == 0; stop--);
+ for (; *buf_end % powers10[i++] == 0; stop--) {}
*end_result= stop; /* index of position after last decimal digit (from 0) */
}
@@ -1011,7 +1011,7 @@ static int ull2dec(ulonglong from, decimal_t *to)
sanity(to);
- for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE);
+ for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) {}
if (unlikely(intg1 > to->len))
{
intg1=to->len;
diff --git a/support-files/ccfilter b/support-files/ccfilter
new file mode 100644
index 00000000000..e2957cd3228
--- /dev/null
+++ b/support-files/ccfilter
@@ -0,0 +1,104 @@
+#! /usr/bin/perl
+
+# Post-processor for compiler output to filter out warnings matched in
+# support-files/compiler_warnings.supp. This makes it easier to check
+# that no new warnings are introduced without needing to submit a build
+# for Buildbot.
+#
+# Use by setting CC="ccfilter gcc" CXX="ccfilter gcc" before ./configure.
+#
+# By default, just filters the output for suppressed warnings. If the
+# FAILONWARNING environment variable is set, then instead will fail the
+# compile on encountering a non-suppressed warnings.
+
+use strict;
+use warnings;
+
+my $suppressions;
+
+open STDOUT_COPY, ">&STDOUT"
+ or die "Failed to dup stdout: $!]n";
+
+my $pid= open(PIPE, '-|');
+
+if (!defined($pid)) {
+ die "Error: Cannot fork(): $!\n";
+} elsif (!$pid) {
+ # Child.
+ # actually want to send the STDERR to the parent, not the STDOUT.
+ # So shuffle things around a bit.
+ open STDERR, ">&STDOUT"
+ or die "Child: Failed to dup pipe to parent: $!\n";
+ open STDOUT, ">&STDOUT_COPY"
+ or die "Child: Failed to dup parent stdout: $!\n";
+ close STDOUT_COPY;
+ exec { $ARGV[0] } @ARGV;
+ die "Child: exec() failed: $!\n";
+} else {
+ # Parent.
+ close STDOUT_COPY;
+ my $cwd= qx(pwd);
+ chomp($cwd);
+ while (<PIPE>) {
+ my $line= $_;
+ if (/^(.*?):([0-9]+): [Ww]arning: (.*)$/) {
+ my ($file, $lineno, $msg)= ($1, $2, $3);
+ $file= "$cwd/$file";
+
+ next
+ if check_if_suppressed($file, $lineno, $msg);
+ die "$line\nGot warning, terminating.\n"
+ if $ENV{FAILONWARNING};
+ print STDERR $line;
+ next;
+ }
+
+ print STDERR $line;
+ }
+ close(PIPE);
+}
+
+exit 0;
+
+sub check_if_suppressed {
+ my ($file, $lineno, $msg)= @_;
+ load_suppressions() unless defined($suppressions);
+ for my $s (@$suppressions) {
+ my ($file_re, $msg_re, $start, $end)= @$s;
+ if ($file =~ /$file_re/ &&
+ $msg =~ /$msg_re/ &&
+ (!defined($start) || $start <= $lineno) &&
+ (!defined($end) || $end >= $lineno)) {
+ return 1;
+ }
+ }
+ return undef;
+}
+
+sub load_suppressions {
+ # First find the suppressions file, might be we need to move up to
+ # the base directory.
+ my $path = "support-files/compiler_warnings.supp";
+ my $exists;
+ for (1..10) {
+ $exists= -f $path;
+ last if $exists;
+ $path= '../'. $path;
+ }
+ die "Error: Could not find suppression file (out of source dir?).\n"
+ unless $exists;
+
+ $suppressions= [];
+ open "F", "<", $path
+ or die "Error: Could not read suppression file '$path': $!\n";
+ while (<F>) {
+ # Skip comment and empty lines.
+ next if /^\s*(\#.*)?$/;
+ die "Invalid syntax in suppression file '$path', line $.:\n$_"
+ unless /^\s*(.+?)\s*:\s*(.+?)\s*(?:[:]\s*([0-9]+)(?:-([0-9]+))?\s*)?$/;
+ my ($file_re, $line_re, $start, $end)= ($1, $2, $3, $4);
+ $end = $start
+ if defined($start) && !defined($end);
+ push @$suppressions, [$file_re, $line_re, $start, $end];
+ }
+}
diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp
index fbe4b3d21c9..535b8666ec1 100644
--- a/support-files/compiler_warnings.supp
+++ b/support-files/compiler_warnings.supp
@@ -25,6 +25,9 @@ sql_yacc.cc : .*switch statement contains 'default' but no 'case' labels.*
pars0grm.tab.c: .*'yyerrorlab' : unreferenced label.*
_flex_tmp.c: .*not enough actual parameters for macro 'yywrap'.*
pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.*
+btr/btr0cur\.c: .*value computed is not used.*: 3175-3375
+include/buf0buf\.ic: unused parameter ‘mtr’
+fil/fil0fil\.c: comparison between signed and unsigned : 3100-3199
#
# bdb is not critical to keep up to date
@@ -41,6 +44,12 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
.*/cmd-line-utils/readline/.* : .*
#
+# Ignore some warnings in libevent, which is not maintained by us.
+#
+.*/extra/libevent/.* : .*unused parameter.*
+.*/extra/libevent/select\.c : .*comparison between signed and unsigned.* : 270-280
+
+#
# Ignore all conversion warnings on windows 64
# (Is safe as we are not yet supporting strings >= 2G)
#
@@ -75,6 +84,17 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used
#
+# I think these are due to mix of C and C++.
+#
+storage/pbxt/ : typedef.*was ignored in this declaration
+
+
+#
+# Groff warnings on OpenSUSE.
+#
+.*/dbug/.*(groff|<standard input>) : .*
+
+#
# Unexplanable (?) stuff
#
listener.cc : .*conversion from 'SOCKET' to 'int'.*