Closed keithrfung closed 2 years ago
Hey @keithrfung , I doubt the logic of the code.
Here the function eg_ciphertext_ballot_selection_is_valid_encryption()
checks for valid encryption. If I am not wrong, then the function must return false if the return type is bool
, or a non-zero value indicating a specific error if return type is int
.
But here the return type is bool, and if an exception occurs then the function will return 5 (a non-zero due to enum type) and it will be considered true
. Please correct me, if I have misinterpreted anything.
I'm going to let @AddressXception follow up on this one.
yes this is a bug. let's slot it into the next release.
Matt already fixed this code.
Is there an existing issue for this?
Suggestion
Resolve C4305 error surrounding truncation.
These can be seen in this example run under
windows-2019-gcc-9.2.0
orwindows-2019-msvc-latest
.Example:
Possible Implementation
No response
Anything else?
MSDocs: https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4305?view=msvc-160