dedis / protobuf

Reflection-based Protocol Buffers for Go
GNU General Public License v2.0
76 stars 15 forks source link

add support for []int #28

Closed marco709394 closed 6 years ago

marco709394 commented 8 years ago

Encode int element as int64

ineiti commented 8 years ago

So this can 'fail' if the sender wants to send a 64-bit int and the receiver only has 32-bit int. It will probably just ignore the too-big value. But this might have consequences.

liamsi commented 8 years ago

So this can 'fail' if the sender wants to send a 64-bit int and the receiver only has 32-bit int. It will probably just ignore the too-big value.

Are sure? On first sight it doesn't seem so.

liamsi commented 8 years ago

I mean, int will always be encoded as int64 here or not: https://github.com/dedis/protobuf/pull/28/files#diff-e214241880c7c5dc058ccee5f600a351R290

liamsi commented 8 years ago

OK, I see the problem you described above @ineiti ...

liamsi commented 8 years ago

My opinion might be buried in this comment: https://github.com/dedis/protobuf/pull/28#discussion_r70075003

ineiti commented 6 years ago

For simplicity, just use the following:

we write a test on the receiver side to see if the int is too big and fail if it is

ineiti commented 6 years ago

Done in #42