You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Delcare optional int32 in .proto file.
2. set the optional field.
3. pack it.
4. unpack it.
5. get the optional field.
What is the expected output? What do you see instead?
I was expecting the optional field back. But it is always the default value(0) .
What version of the product are you using? On what operating system?
version: libprotoc 2.3.0
os: fedora core 10
-- Thanks
Kamanashis Roy
Original issue reported on code.google.com by kamanash...@gmail.com on 5 Jul 2010 at 3:57
The text was updated successfully, but these errors were encountered:
Look in the .h file that is produced from your .proto file and you will see the
structure generated to be filled in. In that structure there is a field called
has_(name of optional field) that must be set to true (or 1) in order for the
macros to pack and unpack the optional field correctly. It appears that this
is not done automatically, but instead must be done manually.
Set that variable, try it again and see if it works.
Original comment by roweandr...@gmail.com on 8 Jul 2010 at 4:17
Original issue reported on code.google.com by
kamanash...@gmail.com
on 5 Jul 2010 at 3:57The text was updated successfully, but these errors were encountered: