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

Issue 762483003: clang: Suppress a -Wstring-conversion warnings in nspr, gyp edition. (Closed)

Created:
6 years ago by Nico
Modified:
6 years ago
Reviewers:
hans, wtc
CC:
chromium-reviews, wtc
Visibility:
Public.

Description

clang: Suppress a -Wstring-conversion warnings in nspr, gyp edition. It started firing in a few more cases recently. BUG=82385 R=hans@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=293109

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -0 lines) Patch
M nss.gyp View 1 chunk +4 lines, -0 lines 1 comment Download

Messages

Total messages: 8 (2 generated)
Nico
6 years ago (2014-11-25 21:30:36 UTC) #2
Nico
6 years ago (2014-11-25 21:30:57 UTC) #3
hans
lgtm
6 years ago (2014-11-25 21:31:57 UTC) #4
Nico
Committed patchset #1 (id:1) manually as r293109 (presubmit successful).
6 years ago (2014-11-25 21:33:58 UTC) #5
wtc
Patch set 1 LGTM. I will fix this warning properly in NSPR upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=1106600 Since ...
6 years ago (2014-12-01 19:05:12 UTC) #7
Nico
6 years ago (2014-12-01 19:10:44 UTC) #8
Message was sent while issue was closed.
On 2014/12/01 19:05:12, wtc wrote:
> Patch set 1 LGTM.
> 
> I will fix this warning properly in NSPR upstream:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1106600
> 
> Since NSS is being replaced in Chromium soon, it is fine to just suppress this
> compiler warning in Chromium.
> 
> https://codereview.chromium.org/762483003/diff/1/nss.gyp
> File nss.gyp (right):
> 
> https://codereview.chromium.org/762483003/diff/1/nss.gyp#newcode257
> nss.gyp:257: # nspr uses assert(!"foo") instead of assert(false && "foo").
> 
> PR_ASSERT(!"foo") can be replaced with PR_NOT_REACHED("foo"). I will fix these
> in this way in the NSPR upstream.
> 
> PR_NOT_REACHED is defined as
> http://mxr.mozilla.org/nspr/ident?i=PR_NOT_REACHED
> 
> The definition doesn't use the !"foo" construct.
> 
> Are you sure the compiler won't warn about assert(false && "foo")? I will need
> to use that construct in one place, where the NSPR file defines its own
> assertion macro.

Yes, false && "foo" is explicitly not warned on by clang as that's considered
the common idiom for "fail an assertion with a descriptive string". This pattern
is used heavily in clang's code itself.

Powered by Google App Engine
This is Rietveld 408576698