Closed Bug 1277014 Opened 3 years ago Closed 3 years ago

Fix -Wstring-conversion warnings in security/manager/ssl/

Categories

(Core :: Security: PSM, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(1 file)

clang's -Wstring-conversion warning warns about the use of string literals as boolean expressions. This is not uncommon in "always fail" assertions, but is usually a bug in any other case. "Always fail" assertions are better expressed using MOZ_ASSERT_UNREACHABLE() or MOZ_CRASH().

security/manager/ssl/nsNSSComponent.cpp:1694:16 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [31]' to 'bool'
security/manager/ssl/nsNSSIOLayer.cpp:1333:16 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [22]' to 'bool'
security/manager/ssl/nsNSSIOLayer.cpp:1341:16 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [22]' to 'bool'
security/manager/ssl/nsNSSIOLayer.cpp:1349:16 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [22]' to 'bool'
security/manager/ssl/nsNSSIOLayer.cpp:1357:16 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [22]' to 'bool'
Comment on attachment 8758371 [details] [diff] [review]
Fix -Wstring-conversion warnings in security/manager/ssl/

Review of attachment 8758371 [details] [diff] [review]:
-----------------------------------------------------------------

great - thanks

::: security/manager/ssl/nsNSSIOLayer.cpp
@@ +1329,5 @@
>  
>  static int
>  _PSM_InvalidInt(void)
>  {
> +    MOZ_ASSERT_UNREACHABLE("I/O method is invalid");

nit: if you feel like it, you can convert these 4-space indented lines to 2 spaces.
Attachment #8758371 - Flags: review?(dkeeler) → review+
(In reply to David Keeler [:keeler] (use needinfo?) from comment #2)
> nit: if you feel like it, you can convert these 4-space indented lines to 2
> spaces.

Thanks. I'll fix these lines' indentation.
Pushed by cpeterson@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2327aa152050
Fix -Wstring-conversion warnings in security/manager/ssl/. r=keeler
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Blocks: 1277428
https://hg.mozilla.org/mozilla-central/rev/2327aa152050
Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.