I think Halil is correct and that the proposed solution provides a way 
around the compiler warning. Thank you for the fix. 

However, I am of the opinion that the design of the proto3 syntax is 
incorrect with respect to default values or values being absent. For 
example, I want to pass a float that represents probability [0 1]. If my 
program decides not to send the probability, how does the recipient know if 
the probability is really 0 or was not sent? With proto2 syntax, it was 
clear if a value was present or not. Using a sentinel value for this 
purpose is fine if it is not also one of the expected possible values. That 
said, discussing the pros and cons of the syntax was not part of the 
original thread and I will rant elsewhere about that. 


On Tuesday, April 9, 2019 at 1:16:25 AM UTC-6, Halil Şen wrote:
>
> I went ahead and created the following patch 
> https://github.com/protocolbuffers/protobuf/pull/6000
>
> On Monday, March 7, 2016 at 11:41:49 PM UTC+1, Feng Xiao wrote:
>>
>> Hi Seth,
>>
>> Could you help submit this as a github issue? 
>> https://github.com/google/protobuf/issues
>>
>> Do you know how we can modify the generated code to avoid this 
>> "float-equal" warning? If you know of a solution, feel free to send us a 
>> patch to fix the code:
>>
>> https://github.com/google/protobuf/blob/master/src/google/protobuf/compiler/cpp/cpp_message.cc#L314
>>
>> On Fri, Mar 4, 2016 at 4:42 PM, Seth Humphries <[email protected]> wrote:
>>
>>> I forgot to add that this occurs after proto buffer generates the pb.h 
>>> and pb.c files. This error occurs inside the generated files when I attempt 
>>> to compile them.  ie the error gives the .pb.c file and line number. 
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Protocol Buffers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at https://groups.google.com/group/protobuf.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to