3 ms·
https://wiki.sei.cmu.edu/confluence/display/c/MEM12-C.+Consider+using+a+goto+chain+when+leaving+a+function+on+error+when+using+and+releasing+resources https://w
by maldev 4y ago
https://wiki.sei.cmu.edu/confluence/display/c/MEM12-C.+Consider+using+a+goto+chain+when+leaving+a+function+on+error+when+using+and+releasing+resources https://wiki.sei.cmu.edu/confluence/display/c/MEM12-C.+Consi...
Here's a copy of the CERT C standard. The site you linked is incorrect. If you google GOTO error handling. Or any of the sort it will come up with it. You should'nt use goto in literally any other case besides this though, which is what I( assume they were referencing.
- jbms 4y agoThanks, that's interesting. AUTOSAR C++14 guidelines don't allow goto in any case. MISRA C++ 2008 does have a couple of rules that allow this specific scenario. MISRA C:2004, "goto shall not be used". MISRA C:2012, it was weakened to "goto should not be used".