Seems an odd use case to capture a constant in a proto file...  but my
suggestion would be to extend FileOptions or MessageOptions and
provide options that hold your constant values.

On Feb 14, 12:15 pm, maxw <> wrote:
> Hello,
> I didn't find crystal-clear confirmation in the documentation, but it
> looks like enum values are considered _signed_ 32-bit integers.  When
> I try to assign 4294967295 to an enum value in a .proto file, protoc
> complains.  Is there any way to have unsigned 32-bit integer
> constants?
> I did find on this forum a suggestion ("Issue 60"), which basically
> declares a "Constants" message, with fields that have default values -
> those default values can then be retrieved.  This does work, and also
> has the benefit of allowing more types of constants (than just 32-bit
> integers).
> The dilemma that I'm facing is what should be the guideline to choose
> between enum and this default value trick?  Would it be considered
> "bad form" to mix both styles?
> Thank you!

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to