Hi,
I've patched Google Proto Buffers protoc compiler with a fix for the
trailing comma issue which produces generated code that fails pedantic
warnings. I've submitted the patch to Google and it will be
incorporated into the 2.0.1beta release (see:
http://groups.google.com/group/protobuf/browse_thread/thread/2e7fffac6fa5c6c9?hl=en).
But, going forward, you will need to have a fixed
protoc in order to properly compile Drizzle after I push later today
with changes for the handler discovery methods.
To fix things, you need to apply the attached patch to the downloaded
source of Google proto buffers library.
Save the attached patch.
Assuming you downloaded Google protobuffers to your desktop...
cd ~/Desktop/protobuf-2.0.0beta/src/google/protobuf/compiler/cpp/
patch -u cpp_enum.cc path_to_downloaded.patch
cd ../../../../../
./configure
sudo make uninstall
make
sudo make install
sudo ldconfig
Cheers,
Jay
--- cpp_enum.cc 2008-08-26 10:57:59.000000000 -0400
+++ cpp_enum.cc.bak 2008-08-26 10:58:16.000000000 -0400
@@ -57,7 +57,14 @@
vars["prefix"] = (descriptor_->containing_type() == NULL) ?
"" : classname_ + "_";
- printer->Print(vars, "$prefix$$name$ = $number$,\n");
+ const char* enum_output;
+ // A trailing comma is a pedantic warning on some C++ compilers
+ // and so we ensure that no trailing slash is present
+ if (i != (descriptor_->value_count() - 1))
+ enum_output = "$prefix$$name$ = $number$, \n";
+ else
+ enum_output = "$prefix$$name$ = $number$\n";
+ printer->Print(vars, enum_output);
if (descriptor_->value(i)->number() < min_value->number()) {
min_value = descriptor_->value(i);
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp