← Back to team overview

maria-developers team mailing list archive

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

 

#At lp:maria

 2750 knielsen@xxxxxxxxxxxxxxx	2009-10-03
      Fix some compiler warnings cause by GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478
      modified:
        storage/maria/ma_blockrec.c
        support-files/compiler_warnings.supp

per-file messages:
  storage/maria/ma_blockrec.c
    GCC warns about const vs. non-const despite cast
    (but it is in any case cleaner to avoid the cast completely)
  support-files/compiler_warnings.supp
    Silence a wrong compiler warning caused by GCC bug.
=== modified file 'storage/maria/ma_blockrec.c'
--- a/storage/maria/ma_blockrec.c	2009-05-06 12:03:24 +0000
+++ b/storage/maria/ma_blockrec.c	2009-10-03 20:13:58 +0000
@@ -5448,7 +5448,7 @@ static size_t fill_insert_undo_parts(MAR
       Store total blob length to make buffer allocation easier during UNDO
      */
     log_parts->str=  info->length_buff;
-    log_parts->length= (uint) (ma_store_length((uchar *) log_parts->str,
+    log_parts->length= (uint) (ma_store_length(info->length_buff,
                                                  info->cur_row.blob_length) -
                                  (uchar*) log_parts->str);
     row_length+=          log_parts->length;
@@ -5592,7 +5592,7 @@ static size_t fill_update_undo_parts(MAR
   MARIA_SHARE *share= info->s;
   MARIA_COLUMNDEF *column, *end_column;
   MARIA_ROW *old_row= &info->cur_row, *new_row= &info->new_row;
-  uchar *field_data, *start_field_data;
+  uchar *field_data, *start_field_data, *length_str;
   uchar *old_field_lengths= old_row->field_lengths;
   uchar *new_field_lengths= new_row->field_lengths;
   size_t row_length= 0;
@@ -5749,9 +5749,9 @@ static size_t fill_update_undo_parts(MAR
 
   /* Store length of field length data before the field/field_lengths */
   field_lengths= (uint) (field_data - start_field_data);
-  start_log_parts->str=  ((start_field_data -
-                           ma_calc_length_for_store_length(field_lengths)));
-  ma_store_length((uchar*)start_log_parts->str, field_lengths);
+  length_str= start_field_data - ma_calc_length_for_store_length(field_lengths);
+  start_log_parts->str= length_str;
+  ma_store_length(length_str, field_lengths);
   start_log_parts->length= (size_t) (field_data - start_log_parts->str);
   row_length+= start_log_parts->length;
   DBUG_RETURN(row_length);

=== modified file 'support-files/compiler_warnings.supp'
--- a/support-files/compiler_warnings.supp	2009-09-03 13:20:22 +0000
+++ b/support-files/compiler_warnings.supp	2009-10-03 20:13:58 +0000
@@ -109,3 +109,6 @@ ma_packrec.c : .*result of 32-bit shift 
 #
 .* : .*no matching operator delete found; memory will not be freed if initialization throws an exception.*
 ctype-simple.c : .*unary minus operator applied to unsigned type, result still unsigned.*
+
+# Wrong warning due to GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478
+regexec\.c : .*passing argument 3 of.*matcher.* discards qualifiers from pointer target type.*