Closed
Bug 771819
Opened 13 years ago
Closed 13 years ago
IdentityCryptoService.cpp:547:64: warning: narrowing conversion of ‘((hashAlg == (SECOidTag)4u) ? 20 : 32)’ from ‘int’ to ‘unsigned int’ inside { } [-Werror=narrowing]
Categories
(Core Graveyard :: Identity, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
938 bytes,
patch
|
Details | Diff | Splinter Review |
New GCC 4.7 build warning:
{
toolkit/identity/IdentityCryptoService.cpp:547:64: warning: narrowing conversion of ‘((hashAlg == (SECOidTag)4u) ? 20 : 32)’ from ‘int’ to ‘unsigned int’ inside { } [-Werror=narrowing]
}
For this chunk of code:
http://hg.mozilla.org/integration/mozilla-inbound/diff/88070ff09ccd/toolkit/identity/IdentityCryptoService.cpp#l1.550
> SECItem hashItem = { siBuffer, hash,
> hashAlg == SEC_OID_SHA1 ? 20 : 32 };
Looks like the compiler is treating the result of "bool ? 20 : 32" as a signed int, and then has to jam that into an unsigned int (for some member-var in SECItem)
Simple fix -- just add a "u" suffix to the raw numbers.
Assignee | ||
Comment 1•13 years ago
|
||
(forgot to mention: this warning is only on inbound so far, since the cset hasn't made it over to mozilla-central yet.)
Attachment #639973 -
Flags: review?(dolske)
Comment 3•13 years ago
|
||
Comment on attachment 639973 [details] [diff] [review]
fix
Fixed by Gavin in https://hg.mozilla.org/mozilla-central/rev/1751d97cc9e4
Attachment #639973 -
Flags: review?(dolske)
Updated•13 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•