[PATCH] mini-gmp: pass correct old_size to custom reallocate function

Niels Möller nisse at lysator.liu.se
Mon Mar 9 11:30:15 UTC 2020


Marco Bodrato <bodrato at mail.dm.unipi.it> writes:

> For the style, I do not know which one is better:
> "if(c){v=val}else{v=0};" or "v=0;if(c){v=val};"

I don't have a very strong opinion on this point, but when it's easy to
do, I prefer to assign once on each code path. Then one (i) doesn't have
to reason about mutated values, and (ii) one may get more accurate
warnings on variables accidentally missing initialization.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list