If you missed it the 35th and 36th occurance of goto fail that really does go directly to fail. if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) goto fail; goto fail; Compulsory bracing of blocks following if/while etc is a piece of syntax Perl got 100% right. Python also got it right in a different way with whitespace. C and C++ really don't have an excuse for not MANDATING compiler warnings at a minimu…
Goto fail
21–30 of 32 posts
Re: Goto fail
#22If you missed it the 35th and 36th occurance of goto fail that really does go directly to fail. if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) goto fail; goto fail; Compulsory bracing of blocks following if/while etc is a piece of syntax Perl got 100% right. Python also got it right in a different way with whitespace. C and C++ really don't have an excuse for not MANDATING compiler warnings at a minimu…
> If you missed it the 35th and 36th occurance of goto fail that really does go directly to fail Whoa, that was entirely unclear from the submission that this was the point. But then, I guess I still don't see what is the point. Why post this here and not file a bug or something?
http://support.apple.com/kb/HT6147
Reported Nov 28th (!):
Re: Goto fail
#23Two consecutive goto fail statements, but no unreachable code warning in the builds?
EDIT: The compiler I use( based on lcc ), gives an Unreachable code warning.
Re: Goto fail
#24Re: Goto fail
#25Re: Goto fail
#26Re: Goto fail
#27Two consecutive goto fail statements, but no unreachable code warning in the builds?
Re: Goto fail
#28Two consecutive goto fail statements, but no unreachable code warning in the builds?
I'm convinced the warnings are there, but were ignored. EDIT: The compiler I use( based on lcc ), gives an Unreachable code warning.
> https://www.imperialviolet.org/2014/02/22/applebug.html
> If I compile with -Wall (enable all warnings), neither GCC 4.8.2 or Clang 3.3 from Xcode make a peep about the dead code.
Re: Goto fail
#29If you missed it the 35th and 36th occurance of goto fail that really does go directly to fail. if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) goto fail; goto fail; Compulsory bracing of blocks following if/while etc is a piece of syntax Perl got 100% right. Python also got it right in a different way with whitespace. C and C++ really don't have an excuse for not MANDATING compiler warnings at a minimu…
> If you missed it the 35th and 36th occurance of goto fail that really does go directly to fail. Yes, I and many others seem to have missed it. That is a legitimate bug. I think the post title should highlight this issue. Now it seems like it's just a "goto is bad but apple uses it anyway" post without much point.
Re: Goto fail
#30What's the point of this post? If you're unfamiliar with "goto fail" in C code... it's a very common error handling pattern. I'm working on some ffmpeg code at the moment. ffmpeg 2.0 contains 554 occurrences of "goto fail". Edit: okay, it appears that the point of OP's post is that someone appears to have copy/pasted an extra "goto fail" at line 631, short circuiting the remainder of the SSLVerifySignedServerKeyExcha…