The default bug view has changed. See this FAQ.

nssilckt.h defines the enumeration constant 'Lock', which conflicts with C++ code defining a 'Lock' class.

RESOLVED FIXED in 3.12.2

Status

NSS
Libraries
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Wan-Teh Chang, Assigned: Wan-Teh Chang)

Tracking

unspecified
3.12.2

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

9 years ago
Created attachment 338767 [details] [diff] [review]
Proposed patch

nssilckt.h defines the enumeration constant 'Lock' unconditionally:

typedef enum  {
    FlushTT = 0,
    NewLock = 1,
    Lock = 2,  <=== PROBLEM!
    Unlock = 3,
    DestroyLock = 4,
    NewCondVar = 5,
    WaitCondVar = 6,
    NotifyCondVar = 7,
    NotifyAllCondVar = 8,
    DestroyCondVar = 9,
    NewMonitor = 10,
    EnterMonitor = 11,
    ExitMonitor = 12,
    Notify = 13,
    NotifyAll = 14,
    Wait = 15,
    DestroyMonitor = 16
} nssILockOp;

This conflicts with C++ code that defines a 'Lock' class.

The fix is to move the definition of this enumeration type
into conditionally compiled code.  My proposed patch also
removes PR_BEGIN_EXTERN_C and PR_END_EXTERN_C, which are
not used in our xxxt.h headers by convention.
Attachment #338767 - Flags: review?(alexei.volkov.bugs)
Is this a public header file?
(Assignee)

Comment 2

9 years ago
Yes.  See
http://mxr.mozilla.org/security/source/security/nss/pkg/solaris/SUNWtlsd/prototype
(Assignee)

Comment 3

9 years ago
Created attachment 338889 [details] [diff] [review]
Proposed patch v2

I added a test case.  Since the C++ rules in coreconf have rotted,
I created the test case in C even though the originally reported problem
is in C++.
Attachment #338767 - Attachment is obsolete: true
Attachment #338889 - Flags: review?(alexei.volkov.bugs)
Attachment #338767 - Flags: review?(alexei.volkov.bugs)

Comment 4

9 years ago
Comment on attachment 338889 [details] [diff] [review]
Proposed patch v2

r=alexei
Attachment #338889 - Flags: review?(alexei.volkov.bugs) → review+
(Assignee)

Comment 5

9 years ago
Created attachment 343678 [details] [diff] [review]
Proposed patch v3 (as checked in)

I changed the test program conflict.c to include "nssilckt.h" directly.
I checked in this patch on the NSS trunk (NSS 3.12.2).

RCS file: /cvsroot/mozilla/security/nss/cmd/tests/conflict.c,v
done
Checking in cmd/tests/conflict.c;
/cvsroot/mozilla/security/nss/cmd/tests/conflict.c,v  <--  conflict.c
initial revision: 1.1
done
Checking in cmd/tests/manifest.mn;
/cvsroot/mozilla/security/nss/cmd/tests/manifest.mn,v  <--  manifest.mn
new revision: 1.7; previous revision: 1.6
done
Checking in lib/util/nssilckt.h;
/cvsroot/mozilla/security/nss/lib/util/nssilckt.h,v  <--  nssilckt.h
new revision: 1.7; previous revision: 1.6
done
Attachment #338889 - Attachment is obsolete: true
(Assignee)

Updated

9 years ago
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.12.2
You need to log in before you can comment on or make changes to this bug.