Proto file format problem

176 views
Skip to first unread message

Chris

unread,
Sep 22, 2008, 6:08:03 AM9/22/08
to Protocol Buffers
There is a disagreement between the documentation at
http://code.google.com/apis/protocolbuffers/docs/proto.html#enum
and the behavior of proto.

The documentation states that
"Enumerator constants must be in the range [0, 2147483647]."

But the protoc program allows negative values.

I happened to write my Haskell version according the documentation, and
noticed this when the unittest.proto defined SPARSE constants there were
negative. My code rejected this as invalid.

Should the documentation be changed (and my Haskell code) or the protoc
program?

Thanks,
Chris

Kenton Varda

unread,
Sep 22, 2008, 2:37:32 PM9/22/08
to Chris, Protocol Buffers
I think the documentation should be changed; I'll fix that.  However, negative enum values should probably be discouraged as they will always be encoded as 10 bytes on the wire.
Reply all
Reply to author
Forward
0 new messages