Status: New
Labels: Type-Defect Priority-Medium

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

What steps will reproduce the problem?
1. Define a message with more than 32 optional fields and compile to c++ header 2. write function that execute has_FIELD() where FIELD is the name of the field it an id greater that 32 3. depending on where you land in the 32 bit has_bits_ variable it may return true even though there is no data in the field.

What is the expected output? What do you see instead?

it should not be random, but give the correct answer.

What version of the product are you using? On what operating system?


Please provide any additional information below.

either don't allow more than 32 optional fields, use unlimited bit field construct to allow unlimited optional fields.

Compiler should not allow this if 32 is the max.

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