Re:Zcoin implementation bug enabled attacker to create over ...
by WalterBright on Tuesday March 07, 2017 @01:26AM
(#13808648)
It should be an error, not a warning (default or not). There are a number of things like this that should just not be accepted anymore. Here's another one:
No compiler should accept that, regardless of switch settings.
[ Parent
| on HN ]
Re:Zcoin implementation bug enabled attacker to create over ...
by jacquesm on Tuesday March 07, 2017 @01:37AM
(#13808684)
Fully agreed. There is absolutely no way that is something a programmer ever intended. In fact I think that just
if (condition);
Should already be enough to trigger the error. (Any 'if' statement without a body).
Re:Zcoin implementation bug enabled attacker to create over ...
by spacemanmatt on Tuesday March 07, 2017 @07:18AM
(#13809791)
There could be an important side-effect in condition. Isn't persistent state fun!?
Re:Zcoin implementation bug enabled attacker to create over ...
by shawabawa3 on Tuesday March 07, 2017 @09:07AM
(#13810366)
Why have it in an if though?
Re:Zcoin implementation bug enabled attacker to create over ...
by spacemanmatt on Wednesday March 08, 2017 @11:49AM
(#13821454)
I am not condoning it, so much as noting what goes wrong when it's easy ;)
Re:Zcoin implementation bug enabled attacker to create over ...
by hasenj on Tuesday March 07, 2017 @09:01AM
(#13810326)
In that case an empty curly block would make the intention explicit.
Re:Zcoin implementation bug enabled attacker to create over ...
by jacquesm on Tuesday March 07, 2017 @09:06AM
(#13810362)
That could still be a case of a dropped line in the body.
Re:Zcoin implementation bug enabled attacker to create over ...
by dagw on Tuesday March 07, 2017 @05:16AM
(#13809409)
It should be an error, not a warning (default or not).
In C++ you can overload '==' to do anything you want, including things that have side effects[0]. Without deeper introspection into the code, it's tricky to check if it's an error or not.
[0] PS. Never do this!
Re:Zcoin implementation bug enabled attacker to create over ...
by WalterBright on Tuesday March 07, 2017 @02:58PM
(#13814133)
Overloading means calling a function, and is treated like calling a function.