← Back to team overview

maria-developers team mailing list archive

bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (knielsen:2721)

 

#At lp:maria

 2721 knielsen@xxxxxxxxxxxxxxx	2009-08-26
      More compiler warnings fixed.
      modified:
        client/mysqlbinlog.cc
        config/ac-macros/misc.m4
        extra/yassl/include/yassl_int.hpp
        extra/yassl/src/handshake.cpp
        extra/yassl/src/yassl_imp.cpp
        extra/yassl/src/yassl_int.cpp
        extra/yassl/taocrypt/include/modes.hpp
        extra/yassl/taocrypt/src/asn.cpp
        mysql-test/valgrind.supp
        sql/strfunc.cc
        storage/pbxt/src/datadic_xt.cc
        storage/pbxt/src/discover_xt.cc
        strings/decimal.c
        support-files/compiler_warnings.supp

per-file messages:
  client/mysqlbinlog.cc
    Fix compiler warnings.
  config/ac-macros/misc.m4
    Fix wrong naming, autoconfig requires _cv_ in cached names.
  extra/yassl/include/yassl_int.hpp
    Fix compiler warnings.
  extra/yassl/src/handshake.cpp
    Fix compiler warnings.
  extra/yassl/src/yassl_imp.cpp
    Fix compiler warnings.
  extra/yassl/src/yassl_int.cpp
    Fix compiler warnings.
  extra/yassl/taocrypt/include/modes.hpp
    Fix compiler warnings.
  extra/yassl/taocrypt/src/asn.cpp
    Fix compiler warnings.
  mysql-test/valgrind.supp
    Make dlclose() suppression catch also another possible call path, seen in new test case.
  sql/strfunc.cc
    Fix compiler warnings.
  storage/pbxt/src/datadic_xt.cc
    Fix compiler warnings.
  storage/pbxt/src/discover_xt.cc
    Fix compiler warnings.
  strings/decimal.c
    Fix compiler warnings.
  support-files/compiler_warnings.supp
    Suppress a few warnings that cannot be meaningfully fixed in source code.
=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc	2009-02-13 16:41:47 +0000
+++ b/client/mysqlbinlog.cc	2009-08-26 12:07:38 +0000
@@ -689,8 +689,8 @@ Exit_status process_event(PRINT_EVENT_IN
     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)

=== modified file 'config/ac-macros/misc.m4'
--- a/config/ac-macros/misc.m4	2008-02-26 17:38:43 +0000
+++ b/config/ac-macros/misc.m4	2009-08-26 12:07:38 +0000
@@ -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

=== modified file 'extra/yassl/include/yassl_int.hpp'
--- a/extra/yassl/include/yassl_int.hpp	2008-11-18 16:45:44 +0000
+++ b/extra/yassl/include/yassl_int.hpp	2009-08-26 12:07:38 +0000
@@ -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;

=== modified file 'extra/yassl/src/handshake.cpp'
--- a/extra/yassl/src/handshake.cpp	2008-04-28 16:24:05 +0000
+++ b/extra/yassl/src/handshake.cpp	2009-08-26 12:07:38 +0000
@@ -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, Buf
 // 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;

=== modified file 'extra/yassl/src/yassl_imp.cpp'
--- a/extra/yassl/src/yassl_imp.cpp	2009-02-13 16:41:47 +0000
+++ b/extra/yassl/src/yassl_imp.cpp	2009-08-26 12:07:38 +0000
@@ -1304,7 +1304,7 @@ void ServerHello::Process(input_buffer&,
     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.useSecurity().set_resuming(false);
             ssl.useLog().Trace("server denied resumption");
         }
+    }
 
     if (ssl.CompressionOn() && !compression_method_)
         ssl.UnSetCompression(); // server isn't supporting yaSSL zlib request

=== modified file 'extra/yassl/src/yassl_int.cpp'
--- a/extra/yassl/src/yassl_int.cpp	2009-02-13 16:41:47 +0000
+++ b/extra/yassl/src/yassl_int.cpp	2009-08-26 12:07:38 +0000
@@ -1833,7 +1833,7 @@ SSL_CTX::GetCA_List() const
 }
 
 
-const VerifyCallback SSL_CTX::getVerifyCallback() const
+VerifyCallback SSL_CTX::getVerifyCallback() const
 {
     return verifyCallback_;
 }

=== modified file 'extra/yassl/taocrypt/include/modes.hpp'
--- a/extra/yassl/taocrypt/include/modes.hpp	2007-03-23 12:43:09 +0000
+++ b/extra/yassl/taocrypt/include/modes.hpp	2009-08-26 12:07:38 +0000
@@ -95,11 +95,12 @@ inline void Mode_BASE::Process(byte* out
 {
     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);
+    }
 }
 
 

=== modified file 'extra/yassl/taocrypt/src/asn.cpp'
--- a/extra/yassl/taocrypt/src/asn.cpp	2009-02-13 16:41:47 +0000
+++ b/extra/yassl/taocrypt/src/asn.cpp	2009-08-26 12:07:38 +0000
@@ -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
         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
             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
         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
             source.SetError(DSA_SZ_E);
             return 0;
         }
+    }
     memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen);
     source.advance(sLen);
 

=== modified file 'mysql-test/valgrind.supp'
--- a/mysql-test/valgrind.supp	2009-08-05 07:21:37 +0000
+++ b/mysql-test/valgrind.supp	2009-08-26 12:07:38 +0000
@@ -387,6 +387,12 @@
    fun:plugin_dl_del(st_mysql_lex_string const*)
 }
 
+#
+# Glibc _dl_close_worker() re-allocates a scope data structure, and frees the
+# old one. This isn't a leak, but generates "still reachable" warnings, as
+# there is no global destructor code to do a final free() at exit().
+#
+
 {
    dlclose memory loss from plugin variant 2
    Memcheck:Leak
@@ -397,7 +403,6 @@
    fun:_dlerror_run
    fun:dlclose
    fun:_Z15free_plugin_memP12st_plugin_dl
-   fun:_Z13plugin_dl_delPK19st_mysql_lex_string
 }
 
 {
@@ -411,7 +416,6 @@
    fun:_dlerror_run
    fun:dlclose
    fun:_Z15free_plugin_memP12st_plugin_dl
-   fun:_Z13plugin_dl_delPK19st_mysql_lex_string
 }
 
 {
@@ -424,7 +428,6 @@
    obj:/lib*/libdl-*.so
    fun:dlclose
    fun:_ZL15free_plugin_memP12st_plugin_dl
-   fun:_ZL13plugin_dl_delPK19st_mysql_lex_string
 }
 
 {
@@ -452,7 +455,6 @@
    fun:_dlerror_run
    fun:dlclose
    fun:_ZL15free_plugin_memP12st_plugin_dl
-   fun:_ZL13plugin_dl_delPK19st_mysql_lex_string
 }
 
 {
@@ -466,7 +468,6 @@
    fun:_dlerror_run
    fun:dlclose
    fun:_ZL15free_plugin_memP12st_plugin_dl
-   fun:_ZL13plugin_dl_delPK19st_mysql_lex_string
 }
 
 {

=== modified file 'sql/strfunc.cc'
--- a/sql/strfunc.cc	2009-04-25 10:05:32 +0000
+++ b/sql/strfunc.cc	2009-08-26 12:07:38 +0000
@@ -148,7 +148,7 @@ static uint parse_name(TYPELIB *lib, con
     }
   }
   else
-    for (; pos != end && *pos != '=' && *pos !=',' ; pos++);
+    for (; pos != end && *pos != '=' && *pos !=',' ; pos++) { }
 
   uint var_len= (uint) (pos - start);
   /* Determine which flag it is */

=== modified file 'storage/pbxt/src/datadic_xt.cc'
--- a/storage/pbxt/src/datadic_xt.cc	2009-03-26 12:18:01 +0000
+++ b/storage/pbxt/src/datadic_xt.cc	2009-08-26 12:07:38 +0000
@@ -2871,5 +2871,5 @@ xtBool XTDDTable::checkCanDrop()
 {
 	/* no refs or references only itself */
 	return (dt_trefs == NULL) || 
-		(dt_trefs->tr_next == NULL) && (dt_trefs->tr_fkey->co_table == this);
+		((dt_trefs->tr_next == NULL) && (dt_trefs->tr_fkey->co_table == this));
 }

=== modified file 'storage/pbxt/src/discover_xt.cc'
--- a/storage/pbxt/src/discover_xt.cc	2009-03-26 12:18:01 +0000
+++ b/storage/pbxt/src/discover_xt.cc	2009-08-26 12:07:38 +0000
@@ -493,8 +493,8 @@ mysql_prepare_create_table(THD *thd, HA_
     }
     /* 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_
 	    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

=== modified file 'strings/decimal.c'
--- a/strings/decimal.c	2009-05-06 12:03:24 +0000
+++ b/strings/decimal.c	2009-08-26 12:07:38 +0000
@@ -306,7 +306,7 @@ int decimal_actual_fraction(decimal_t *f
   {
     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 *fro
     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, decim
 
   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;

=== modified file 'support-files/compiler_warnings.supp'
--- a/support-files/compiler_warnings.supp	2009-08-24 13:56:18 +0000
+++ b/support-files/compiler_warnings.supp	2009-08-26 12:07:38 +0000
@@ -84,6 +84,17 @@ db_vrfy.c : .*comparison is always false
 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'.*




Follow ups