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

Issue 2455943002: Improve RTC_DCHECK_op so that it won't trigger useless compiler warnings (Closed)

Created:
4 years, 1 month ago by kwiberg-webrtc
Modified:
4 years, 1 month ago
Reviewers:
ossu, kjellander_webrtc
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Improve RTC_DCHECK_op so that it won't trigger useless compiler warnings Before this change, with DCHECKs switched off, this sort of check size_t index = ...; RTC_DCHECK_GE(index, 0u); would cause GCC (but no other compiler that we use) to complain that unsigned values are always greater than or equal to 0. With this change, it no longer complains. (It was and remains the case that there was no complaints if DCHECKs were switched on, or if you used RTC_CHECK_op.) The reason for doing this change is that it isn't useful for the compiler to force us to remove DCHECKs just because their condition can be verified statically. That causes us to remove the checks, and once that's happened, future code changes are free to violate the removed checks and no one will know... BUG=webrtc:6620 Committed: https://crrev.com/32bcaf61f52f604c7e268533b43f1ee0a61dff43 Cr-Commit-Position: refs/heads/master@{#14805}

Patch Set 1 #

Total comments: 2

Patch Set 2 : review comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -10 lines) Patch
M webrtc/base/checks.h View 1 2 chunks +18 lines, -10 lines 0 comments Download

Messages

Total messages: 22 (10 generated)
kwiberg-webrtc
Because I don't think it's useful for the compiler to force us to remove DCHECKs ...
4 years, 1 month ago (2016-10-27 10:57:51 UTC) #3
ossu
I tried looking at the code and I'm not sure why this doesn't happen with ...
4 years, 1 month ago (2016-10-27 13:11:01 UTC) #4
kwiberg-webrtc
On 2016/10/27 13:11:01, ossu wrote: > I tried looking at the code and I'm not ...
4 years, 1 month ago (2016-10-27 15:17:30 UTC) #6
kwiberg-webrtc
https://codereview.webrtc.org/2455943002/diff/1/webrtc/base/checks.h File webrtc/base/checks.h (right): https://codereview.webrtc.org/2455943002/diff/1/webrtc/base/checks.h#newcode102 webrtc/base/checks.h:102: (void)(a), (void)(b), true)) On 2016/10/27 13:11:01, ossu wrote: > ...
4 years, 1 month ago (2016-10-27 15:27:31 UTC) #7
ossu
On 2016/10/27 15:17:30, kwiberg-webrtc wrote: > On 2016/10/27 13:11:01, ossu wrote: > > I tried ...
4 years, 1 month ago (2016-10-27 15:35:32 UTC) #8
kjellander_webrtc
I know to little about macros to provide useful input here. I trust ossu! Thanks ...
4 years, 1 month ago (2016-10-27 19:56:39 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2455943002/20001
4 years, 1 month ago (2016-10-27 20:21:57 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/9614)
4 years, 1 month ago (2016-10-27 20:24:07 UTC) #14
kwiberg-webrtc
On 2016/10/27 19:56:39, kjellander_webrtc wrote: > I guess I will discard https://codereview.webrtc.org/2450223002/ once this is ...
4 years, 1 month ago (2016-10-27 20:24:30 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2455943002/20001
4 years, 1 month ago (2016-10-27 20:34:45 UTC) #18
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 1 month ago (2016-10-27 20:36:02 UTC) #20
commit-bot: I haz the power
4 years, 1 month ago (2016-10-27 20:36:18 UTC) #22
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/32bcaf61f52f604c7e268533b43f1ee0a61dff43
Cr-Commit-Position: refs/heads/master@{#14805}

Powered by Google App Engine
This is Rietveld 408576698