Closed Bug 818943 Opened 12 years ago Closed 11 years ago

tdcache.c:704:49: warning: comparison between ‘PRStatus’ and ‘enum _SECStatus’ [-Wenum-compare]

Categories

(NSS :: Libraries, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
3.15.1

People

(Reporter: dholbert, Assigned: Cykesiopka)

References

()

Details

Attachments

(1 file)

GCC build warning when building mozilla-central (specifically, the NSS parts):
{
tdcache.c:704:49: warning: comparison between ‘PRStatus’ and ‘enum _SECStatus’ [-Wenum-compare]
}

This is from this line:
> 704 	    if (nssPKIObject_AddInstance(to, instance) == SECSuccess) {
https://mxr.mozilla.org/mozilla-central/source/security/nss/lib/pki/tdcache.c#704

...and it's warning because nssPKIObject_AddInstance returns type PRStatus, e.g. "PR_SUCCESS", not SECSuccess.  For reference, here's the nssPKIObject_AddInstance impl:
https://mxr.mozilla.org/mozilla-central/source/security/nss/lib/pki/pkibase.c#164

So: this code needs s/SECSuccess/PR_SUCCESS/

Pretty sure this still affects NSS trunk -- at least, it's broken in the latest version available here (3.14): ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/
(Fortunately, SECSuccess and PR_SUCCESS happen to have the same value, so even though we're using the wrong one, we should still get the intended behavior.)

Citations:
> 458 typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus;
https://mxr.mozilla.org/mozilla-central/source/nsprpub/pr/include/prtypes.h#458

> 73     SECSuccess = 0
https://mxr.mozilla.org/mozilla-central/source/security/nss/lib/util/seccomon.h#73
Attached patch Proposed PatchSplinter Review
s/SECSuccess/PR_SUCCESS/ as dholbert suggested.
Attachment #755864 - Flags: review?(wtc)
Comment on attachment 755864 [details] [diff] [review]
Proposed Patch

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

r=wtc.

https://hg.mozilla.org/projects/nss/rev/63d7326041b7
Attachment #755864 - Flags: review?(wtc)
Attachment #755864 - Flags: review+
Attachment #755864 - Flags: checked-in+
Assignee: nobody → cykesiopka.bmo
Severity: normal → trivial
Status: NEW → RESOLVED
Closed: 11 years ago
Priority: -- → P2
Resolution: --- → FIXED
Target Milestone: --- → 3.15.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: