Comment #1 on issue 313 by in c++ generated header, has_FIELD will return random results if more than 32 optional fields defined in single message

This should not happen. What platform are you using? Can you write a simple deomo for this issue? Please upload the .proto and generated .pb.h in question.

We use an array of int32 for HAS_bit. The actually has_ bit is stored in has_array[ (field_index) / 32]. The mask is 1u << (field_index % 32).

BTW, if you use x64 platform in MSVC professional, there was a bug about generating the has bit mask. It's fixed in r402.

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