Doubles in Message cause truncation

21 views
Skip to first unread message

Randy Nuss

unread,
Oct 7, 2020, 10:15:44 AM10/7/20
to Protocol Buffers
I'm having an issue where fields in my .proto file with type 'double' do not get serialized and seem to cause the serialization process to halt and truncate the remaining message.  If I change from 'double' to 'float' then SerializeToString() and ParseFromString() work as expected.

Coding:   C++
Compiler:   Visual Studio 2019
Architecture selection:   amd64
Protobuf Library and protoc:   protobuf_x64-windows-static

syntax = "proto3";
package decodedBuff;
message Parameter {
    string metric_units = 1;
    string units = 2;
    double test1 = 3;
    double value = 4;
    int32 decode_type = 5;
    string source = 6;
}

// Serialize the message
static std::string buff;
parmList.SerializeToString(&buff);
Reply all
Reply to author
Forward
0 new messages