Open Bug 301556 Opened 19 years ago Updated 2 years ago

nsID.h uses non-const casts to PRUint32 where the casts should be const

Categories

(Core :: XPCOM, defect, P5)

defect

Tracking

()

People

(Reporter: sven, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050707
Build Identifier: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050707

In the header file nsID.h, there is an inline implementation of
nsID::Equals(const nsID &other). This implementation casts the m0 class members
to "PRUint32 *" for comparison. However, the m0 members are constant in this
context and thus I believe they should be have been cast to "const PRUint32 *"
instead. My compiler (GCC 2.95) complains about the non-const casts (even though
there are no assignments involved, it complains anyhow).

Reproducible: Always

Steps to Reproduce:
Compile something using nsID.h with warnings turned on in GCC 2.95.

Actual Results:  
My compiler complains about casting const members to non-const.

Expected Results:  
I expect to find the correct casts in the nsID.h header file.
Component: Embedding: GRE Core → XPCOM
QA Contact: xpcom
http://lxr.mozilla.org/seamonkey/source/xpcom/base/nsID.h#74
confirmed through IRC
Status: UNCONFIRMED → NEW
Ever confirmed: true
mass reassigning to nobody.
Assignee: dougt → nobody
Priority: -- → P5
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.