tag:blogger.com,1999:blog-7347279.post5197911621256825014..comments2023-08-26T05:04:33.009-04:00Comments on anti-virus rants: the case against GOTO in securitykurt wismerhttp://www.blogger.com/profile/03810635947269551517noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-7347279.post-90302204777209308712014-03-11T23:34:15.754-04:002014-03-11T23:34:15.754-04:00@Matt Boney:
i do in fact mean literally the keywo...@Matt Boney:<br />i do in fact mean literally the keyword GOTO. i'm aware that RETURN and BREAK are related to GOTO, but they are much more constrained than GOTO. for example, neither RETURN nor BREAK can jump to a point in the code preceding themselves. the constraints on RETURN and BREAK reduce the amount of complexity using them can add.<br /><br />while i'd certainly agree that skipping important behaviour is bad, that is something that can be done with all kinds of statements. even getting the conditional expression in an IF statement wrong can lead to that. kurt wismerhttps://www.blogger.com/profile/03810635947269551517noreply@blogger.comtag:blogger.com,1999:blog-7347279.post-73452845059678017512014-03-11T20:59:17.020-04:002014-03-11T20:59:17.020-04:00Do you mean goto in the generic sense of an uncond...Do you mean goto in the generic sense of an unconditional jump or literally the keyword goto?<br /><br />do<br />{<br /> int rv = something();<br /> if (!rv)<br /> {<br /> /* GOTO */<br /> break;<br /> }<br /> something_else();<br />} while(0)<br /><br />int some_function()<br />{<br /> int rv = something();<br /> if (!rv)<br /> {<br /> /* effectively a goto */<br /> return 0;<br /> }<br /> <br /> return something_important();<br />}<br /><br />Harping on the goto keyword is pretty pointless, really the culpret is control flow semantics that skip very important behavior.Anonymoushttps://www.blogger.com/profile/02989861723418043330noreply@blogger.com