Commit c4a0e693 authored by Robert Edmonds's avatar Robert Edmonds

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.
parent f25a0f4e
...@@ -45,6 +45,7 @@ enum TestEnumDupValues { ...@@ -45,6 +45,7 @@ enum TestEnumDupValues {
VALUE_F = 1000; VALUE_F = 1000;
VALUE_AA = 1000; VALUE_AA = 1000;
VALUE_BB = 1001; VALUE_BB = 1001;
option allow_alias = true;
} }
message TestFieldNo15 { // should use 1 byte header message TestFieldNo15 { // should use 1 byte header
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment