On 25/08/17 02:40, Christian Hesse wrote: > David Sommerseth <open...@sf.lists.topphemmelig.net> on Thu, 2017/08/24 20:16: >> On 24/08/17 09:57, Antonio Quartulli wrote: >>> My effort in writing the commit message has been quite poor. >>> >>> The assignment is useless because 'ret' is re-assigned a few lines later >>> without ever being read. >> >> Hmmm. I'm not convinced of this change. But I'm also weird in these >> cases :) >> >> I think it is good defensive programming to predefine the state of >> variables. When that is not done, it is up the the compiler to decide >> what to do - which most of the times does a sane job these days. But >> you're at the mercy of the compiler. >> >> In this case, I would expect the compiler to optimize this out anyway, >> regardless of the approaches used. The compiler doesn't necessarily set >> the value first to true and then to change it to the output of >> multi_process_post(). It might just as well postpone the declaration. >> >> So I think a better approach would be to completely move the "bool ret" >> down. So it will become: >> >> bool ret = multi_process_post(m, mi, mpp_flags); >> >> Which I think is also closer to what the compiler would end up with anyway. > > ISO C90 forbids mixed declarations and code in C. Probably compilers will > start to complain.
We try to stick to C99. I think it allows such mix, no? Cheers, -- Antonio Quartulli
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel