Hey all,

There are a couple of different unrelated issues awaiting anyone who
wants to build Drizzle with gcc 4.4. The first relates to Protobuf.
You'll see errors like this:

binary_log.pb.cc:45: error: narrowing conversion of '(((long
int)(&16u->BinaryLog::Header::server_id_)) + -0x00000000000000010l)'
from 'long int' to 'const int' inside { } [-fpermissive]

This is a bug in GCC 4.4, and AIUI, there is a fix already committed to
GCC. In the meantime, I have a patch, which I'm attaching, to Protobuf
2.1 which works around it. The patch will not be applied upstream, as it
makes some variables bigger, and he problem is fixed already in GCC. But
if you are dead in the water, here it is.

The second is in sql_string. We have a fix in the tree that is wrong in
some cases, so there is a patch coming that will revert this fix. This
will break gcc 4.4 again. I'm working on a better patch for the problem
- and should hopefully have something soon.

Monty
=== modified file 'src/google/protobuf/compiler/cpp/cpp_message.cc'
--- src/google/protobuf/compiler/cpp/cpp_message.cc     2009-05-21 22:30:16 
+0000
+++ src/google/protobuf/compiler/cpp/cpp_message.cc     2009-05-21 22:14:54 
+0000
@@ -706,7 +706,7 @@
 void MessageGenerator::
 GenerateOffsets(io::Printer* printer) {
   printer->Print(
-    "static const int $classname$_offsets_[$field_count$] = {\n",
+    "static const ptrdiff_t $classname$_offsets_[$field_count$] = {\n",
     "classname", classname_,
     "field_count", SimpleItoa(max(1, descriptor_->field_count())));
   printer->Indent();

=== modified file 'src/google/protobuf/descriptor.pb.cc'
--- src/google/protobuf/descriptor.pb.cc        2009-05-21 22:30:16 +0000
+++ src/google/protobuf/descriptor.pb.cc        2009-05-21 22:24:51 +0000
@@ -81,7 +81,7 @@
       "google/protobuf/descriptor.proto");
   GOOGLE_CHECK(file != NULL);
   FileDescriptorSet_descriptor_ = file->message_type(0);
-  static const int FileDescriptorSet_offsets_[1] = {
+  static const ptrdiff_t FileDescriptorSet_offsets_[1] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, file_),
   };
   FileDescriptorSet_reflection_ =
@@ -96,7 +96,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(FileDescriptorSet));
   FileDescriptorProto_descriptor_ = file->message_type(1);
-  static const int FileDescriptorProto_offsets_[8] = {
+  static const ptrdiff_t FileDescriptorProto_offsets_[8] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, name_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, 
package_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, 
dependency_),
@@ -118,7 +118,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(FileDescriptorProto));
   DescriptorProto_descriptor_ = file->message_type(2);
-  static const int DescriptorProto_offsets_[7] = {
+  static const ptrdiff_t DescriptorProto_offsets_[7] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, name_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, field_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, 
extension_),
@@ -139,7 +139,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(DescriptorProto));
   DescriptorProto_ExtensionRange_descriptor_ = 
DescriptorProto_descriptor_->nested_type(0);
-  static const int DescriptorProto_ExtensionRange_offsets_[2] = {
+  static const ptrdiff_t DescriptorProto_ExtensionRange_offsets_[2] = {
     
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, 
start_),
     
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, 
end_),
   };
@@ -155,7 +155,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(DescriptorProto_ExtensionRange));
   FieldDescriptorProto_descriptor_ = file->message_type(3);
-  static const int FieldDescriptorProto_offsets_[8] = {
+  static const ptrdiff_t FieldDescriptorProto_offsets_[8] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, 
name_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, 
number_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, 
label_),
@@ -179,7 +179,7 @@
   FieldDescriptorProto_Type_descriptor_ = 
FieldDescriptorProto_descriptor_->enum_type(0);
   FieldDescriptorProto_Label_descriptor_ = 
FieldDescriptorProto_descriptor_->enum_type(1);
   EnumDescriptorProto_descriptor_ = file->message_type(4);
-  static const int EnumDescriptorProto_offsets_[3] = {
+  static const ptrdiff_t EnumDescriptorProto_offsets_[3] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, name_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, 
value_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, 
options_),
@@ -196,7 +196,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(EnumDescriptorProto));
   EnumValueDescriptorProto_descriptor_ = file->message_type(5);
-  static const int EnumValueDescriptorProto_offsets_[3] = {
+  static const ptrdiff_t EnumValueDescriptorProto_offsets_[3] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, 
name_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, 
number_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, 
options_),
@@ -213,7 +213,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(EnumValueDescriptorProto));
   ServiceDescriptorProto_descriptor_ = file->message_type(6);
-  static const int ServiceDescriptorProto_offsets_[3] = {
+  static const ptrdiff_t ServiceDescriptorProto_offsets_[3] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, 
name_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, 
method_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, 
options_),
@@ -230,7 +230,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(ServiceDescriptorProto));
   MethodDescriptorProto_descriptor_ = file->message_type(7);
-  static const int MethodDescriptorProto_offsets_[4] = {
+  static const ptrdiff_t MethodDescriptorProto_offsets_[4] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, 
name_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, 
input_type_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, 
output_type_),
@@ -248,7 +248,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(MethodDescriptorProto));
   FileOptions_descriptor_ = file->message_type(8);
-  static const int FileOptions_offsets_[5] = {
+  static const ptrdiff_t FileOptions_offsets_[5] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_package_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, 
java_outer_classname_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, 
java_multiple_files_),
@@ -268,7 +268,7 @@
       sizeof(FileOptions));
   FileOptions_OptimizeMode_descriptor_ = FileOptions_descriptor_->enum_type(0);
   MessageOptions_descriptor_ = file->message_type(9);
-  static const int MessageOptions_offsets_[2] = {
+  static const ptrdiff_t MessageOptions_offsets_[2] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, 
message_set_wire_format_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, 
uninterpreted_option_),
   };
@@ -284,7 +284,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(MessageOptions));
   FieldOptions_descriptor_ = file->message_type(10);
-  static const int FieldOptions_offsets_[5] = {
+  static const ptrdiff_t FieldOptions_offsets_[5] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, ctype_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, packed_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, deprecated_),
@@ -304,7 +304,7 @@
       sizeof(FieldOptions));
   FieldOptions_CType_descriptor_ = FieldOptions_descriptor_->enum_type(0);
   EnumOptions_descriptor_ = file->message_type(11);
-  static const int EnumOptions_offsets_[1] = {
+  static const ptrdiff_t EnumOptions_offsets_[1] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, 
uninterpreted_option_),
   };
   EnumOptions_reflection_ =
@@ -319,7 +319,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(EnumOptions));
   EnumValueOptions_descriptor_ = file->message_type(12);
-  static const int EnumValueOptions_offsets_[1] = {
+  static const ptrdiff_t EnumValueOptions_offsets_[1] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, 
uninterpreted_option_),
   };
   EnumValueOptions_reflection_ =
@@ -334,7 +334,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(EnumValueOptions));
   ServiceOptions_descriptor_ = file->message_type(13);
-  static const int ServiceOptions_offsets_[1] = {
+  static const ptrdiff_t ServiceOptions_offsets_[1] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, 
uninterpreted_option_),
   };
   ServiceOptions_reflection_ =
@@ -349,7 +349,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(ServiceOptions));
   MethodOptions_descriptor_ = file->message_type(14);
-  static const int MethodOptions_offsets_[1] = {
+  static const ptrdiff_t MethodOptions_offsets_[1] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, 
uninterpreted_option_),
   };
   MethodOptions_reflection_ =
@@ -364,7 +364,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(MethodOptions));
   UninterpretedOption_descriptor_ = file->message_type(15);
-  static const int UninterpretedOption_offsets_[6] = {
+  static const ptrdiff_t UninterpretedOption_offsets_[6] = {
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, name_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, 
identifier_value_),
     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, 
positive_int_value_),
@@ -384,7 +384,7 @@
       ::google::protobuf::MessageFactory::generated_factory(),
       sizeof(UninterpretedOption));
   UninterpretedOption_NamePart_descriptor_ = 
UninterpretedOption_descriptor_->nested_type(0);
-  static const int UninterpretedOption_NamePart_offsets_[2] = {
+  static ptrdiff_t UninterpretedOption_NamePart_offsets_[2] = {
     
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, 
name_part_),
     
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, 
is_extension_),
   };

=== modified file 'src/google/protobuf/dynamic_message.cc'
--- src/google/protobuf/dynamic_message.cc      2009-05-21 22:30:16 +0000
+++ src/google/protobuf/dynamic_message.cc      2009-05-21 22:28:20 +0000
@@ -168,7 +168,7 @@
 
     // Warning:  The order in which the following pointers are defined is
     //   important (the prototype must be deleted *before* the offsets).
-    scoped_array<int> offsets;
+    scoped_array<ptrdiff_t> offsets;
     scoped_ptr<const GeneratedMessageReflection> reflection;
     scoped_ptr<const DynamicMessage> prototype;
   };
@@ -446,7 +446,7 @@
   //   or not that field is set.
 
   // Compute size and offsets.
-  int* offsets = new int[type->field_count()];
+  ptrdiff_t* offsets = new ptrdiff_t[type->field_count()];
   type_info->offsets.reset(offsets);
 
   // Decide all field offsets by packing in order.

=== modified file 'src/google/protobuf/generated_message_reflection.cc'
--- src/google/protobuf/generated_message_reflection.cc 2009-05-21 22:30:16 
+0000
+++ src/google/protobuf/generated_message_reflection.cc 2009-05-21 22:16:01 
+0000
@@ -170,7 +170,7 @@
 GeneratedMessageReflection::GeneratedMessageReflection(
     const Descriptor* descriptor,
     const Message* default_instance,
-    const int offsets[],
+    const ptrdiff_t offsets[],
     int has_bits_offset,
     int unknown_fields_offset,
     int extensions_offset,

=== modified file 'src/google/protobuf/generated_message_reflection.h'
--- src/google/protobuf/generated_message_reflection.h  2009-05-21 22:30:16 
+0000
+++ src/google/protobuf/generated_message_reflection.h  2009-05-21 22:18:29 
+0000
@@ -121,7 +121,7 @@
   //                  by sizeof().
   GeneratedMessageReflection(const Descriptor* descriptor,
                              const Message* default_instance,
-                             const int offsets[],
+                             const ptrdiff_t offsets[],
                              int has_bits_offset,
                              int unknown_fields_offset,
                              int extensions_offset,
@@ -268,7 +268,7 @@
 
   const Descriptor* descriptor_;
   const Message* default_instance_;
-  const int* offsets_;
+  const ptrdiff_t* offsets_;
 
   int has_bits_offset_;
   int unknown_fields_offset_;

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to