Re: Always brace your ifs

2014-02-22 Thread Mike Hoye
On 2/22/2014, 1:04 PM, Jet Villegas wrote: goto ftw; I have to admit, I was very surprised to learn that: - Using both -Wall and -Wextra doesn't get you -Wunreachable-code. - The Clang manual lists documenting any of that that as a todo. - mhoye

Re: Always brace your ifs

2014-02-22 Thread Reuben Morais
On Feb 22, 2014, at 16:53, Mike Hoye mh...@mozilla.com wrote: On 2/22/2014, 1:04 PM, Jet Villegas wrote: goto ftw; I have to admit, I was very surprised to learn that: - Using both -Wall and -Wextra doesn't get you -Wunreachable-code. - The Clang manual lists documenting any of that that as

Re: Always brace your ifs

2014-02-22 Thread Hubert Figuière
On 22/02/14 02:53 PM, Mike Hoye wrote: On 2/22/2014, 1:04 PM, Jet Villegas wrote: goto ftw; I have to admit, I was very surprised to learn that: - Using both -Wall and -Wextra doesn't get you -Wunreachable-code. - The Clang manual lists documenting any of that that as a todo. Now we talk

Re: We live in a memory-constrained world

2014-02-22 Thread Nicholas Nethercote
On Sat, Feb 22, 2014 at 11:22 PM, Andreas Gal andreas@gmail.com wrote: So, I'm wondering how much effort we should put in reducing the number of ChromeWorkers. We should continue to use JS in Chrome where it makes sense. Its often easier and faster to write some functionality in JS (and

Re: Always brace your ifs

2014-02-22 Thread Justin Dolske
On 2/22/14 7:18 AM, Kyle Huey wrote: If you needed another reason to follow the style guide: https://www.imperialviolet.org/2014/02/22/applebug.html I don't really disagree with bracing being a good idea, but I'll be contrarian here. Mandatory bracing probably wouldn't have helped; since you

Re: Always brace your ifs

2014-02-22 Thread Gregory Szorc
On Feb 22, 2014, at 8:18, Kyle Huey m...@kylehuey.com wrote: If you needed another reason to follow the style guide: https://www.imperialviolet.org/2014/02/22/applebug.html Code coverage would have caught this as well. The time investment into 100% line and branch coverage is debatable. But

Re: Always brace your ifs

2014-02-22 Thread Kyle Huey
On Sat, Feb 22, 2014 at 3:22 PM, Justin Dolske dol...@mozilla.com wrote: On 2/22/14 7:18 AM, Kyle Huey wrote: If you needed another reason to follow the style guide: https://www.imperialviolet.org/2014/02/22/applebug.html I don't really disagree with bracing being a good idea, but I'll be

Re: Always brace your ifs

2014-02-22 Thread Kyle Huey
On Sat, Feb 22, 2014 at 3:57 PM, Gregory Szorc g...@mozilla.com wrote: On Feb 22, 2014, at 8:18, Kyle Huey m...@kylehuey.com wrote: If you needed another reason to follow the style guide: https://www.imperialviolet.org/2014/02/22/applebug.html Code coverage would have caught this as well.

Re: Always brace your ifs

2014-02-22 Thread Joshua Cranmer 
On 2/22/2014 5:57 PM, Gregory Szorc wrote: On Feb 22, 2014, at 8:18, Kyle Huey m...@kylehuey.com wrote: If you needed another reason to follow the style guide: https://www.imperialviolet.org/2014/02/22/applebug.html Code coverage would have caught this as well. Actually, it probably

Re: Always brace your ifs

2014-02-22 Thread Joshua Cranmer 
On 2/22/2014 5:22 PM, Justin Dolske wrote: But really, the best way to fix this would be to use a macro: err = SSLHashSHA1.update(hashCtx, foo); SSL_ENSURE_SUCCESS(err, err); err = SSLHashSHA1.update(hashCtx, bar); SSL_ENSURE_SUCCESS(err, err); err = SSLHashSHA1.update(hashCtx, baz);

Re: Always brace your ifs

2014-02-22 Thread Kyle Huey
On Sat, Feb 22, 2014 at 4:38 PM, Joshua Cranmer  pidgeo...@gmail.com wrote: On 2/22/2014 5:22 PM, Justin Dolske wrote: But really, the best way to fix this would be to use a macro: err = SSLHashSHA1.update(hashCtx, foo); SSL_ENSURE_SUCCESS(err, err); err = SSLHashSHA1.update(hashCtx,

Re: Always brace your ifs

2014-02-22 Thread Neil
Joshua Cranmer wrote: Justin Dolske wrote: But really, the best way to fix this would be to use a macro: err = SSLHashSHA1.update(hashCtx, foo); SSL_ENSURE_SUCCESS(err, err); err = SSLHashSHA1.update(hashCtx, bar); SSL_ENSURE_SUCCESS(err, err); err = SSLHashSHA1.update(hashCtx,

Re: Always brace your ifs

2014-02-22 Thread L. David Baron
On Saturday 2014-02-22 15:57 -0800, Gregory Szorc wrote: On Feb 22, 2014, at 8:18, Kyle Huey m...@kylehuey.com wrote: If you needed another reason to follow the style guide: https://www.imperialviolet.org/2014/02/22/applebug.html Code coverage would have caught this as well. The time

Re: Always brace your ifs

2014-02-22 Thread Brian Smith
On Sat, Feb 22, 2014 at 5:06 PM, Neil n...@parkwaycc.co.uk wrote: Joshua Cranmer wrote: Being serious here, early-return and RTTI (to handle the cleanup prior to exit) would have eliminated the need for gotos in the first place. I assume you mean RAII. Unfortunately that requires C++. (I was