Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Issue 26885006: - Make sure values are "used" as part of ASSERT even when compiling optimized. (Closed)

Created:
7 years, 2 months ago by Ivan Posva
Modified:
7 years, 2 months ago
Reviewers:
floitsch, kustermann
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

- Make sure values are "used" as part of ASSERT even when compiling optimized. R=floitsch@google.com Committed: https://code.google.com/p/dart/source/detail?r=28528

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -1 line) Patch
M runtime/third_party/double-conversion/src/utils.h View 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
Ivan Posva
clang 3.4 is complaining unless we make the inputs to ASSERT used: runtime/third_party/double-conversion/src/cached-powers.cc:134:18: error: unused ...
7 years, 2 months ago (2013-10-11 05:09:36 UTC) #1
floitsch
LGTM, although I would be afraid that GCC will eventually warn about dead-code... I googled ...
7 years, 2 months ago (2013-10-11 08:00:47 UTC) #2
Ivan Posva
On 2013/10/11 08:00:47, floitsch wrote: > LGTM, although I would be afraid that GCC will ...
7 years, 2 months ago (2013-10-11 16:59:58 UTC) #3
Ivan Posva
Committed patchset #1 manually as r28528.
7 years, 2 months ago (2013-10-11 17:02:47 UTC) #4
floitsch
7 years, 2 months ago (2013-10-11 17:11:08 UTC) #5
Message was sent while issue was closed.
On 2013/10/11 16:59:58, Ivan Posva wrote:
> On 2013/10/11 08:00:47, floitsch wrote:
> > LGTM, although I would be afraid that GCC will eventually warn about
> > dead-code...
> > I googled a little bit and found:
> > ===
> > #ifdef NDEBUG
> > #define ASSERT(expression) assert(expression)
> > #else
> > #define ASSERT(expression) ((void) expression)
> > #endif
> > ===
> > 
> > I slightly prefer this version, but don't change the CL just for me.
> > 
> > I will look into doing something similar in the double-conversion library.
> > Note, that we also have some other warning-problem with newer GCCs:
> > https://code.google.com/p/double-conversion/issues/detail?id=37
> > I believe this is not just the double-conversion library but also triggers
in
> > the Dart VM.
> 
> If I understand your suggestion, it will execute the expression.
Yes. In double-conversion that would have been ok. But I must admit that this is
counter-intuitive for ASSERTs.
> 
> -Ivan

Powered by Google App Engine
This is Rietveld 408576698