From c4a0e69337cbecfc9fad607f07a93445f0e3286d Mon Sep 17 00:00:00 2001 From: Robert Edmonds Date: Fri, 5 Sep 2014 15:38:26 -0400 Subject: [PATCH] t/test-full.proto: add 'allow_alias' option to TestEnumDupValues protobuf 2.5.0 started warning that we would need to enable the 'allow_alias' option on this enum due to the duplicate enum values, and protobuf 2.6.0 turned this into an error. Turn this option on, now that protobuf 2.5.0 is more common (e.g., it's now in Ubuntu 14.04 LTS). This will break with older protobuf versions, so we now require >= 2.5.0. We should now see diagnostics like these disappear from the build log: [libprotobuf ERROR google/protobuf/descriptor.cc:4153] "foo.VALUE_B" uses the same enum value as "foo.VALUE_A". If this is intended, set 'option allow_alias = true;' to the enum definition. Based on a patch from Ilya Lipnitskiy. --- t/test-full.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/t/test-full.proto b/t/test-full.proto index 58e7bfc..9fd2550 100644 --- a/t/test-full.proto +++ b/t/test-full.proto @@ -45,6 +45,7 @@ enum TestEnumDupValues { VALUE_F = 1000; VALUE_AA = 1000; VALUE_BB = 1001; + option allow_alias = true; } message TestFieldNo15 { // should use 1 byte header