Warning: nsHTMLAttributes.h: "mBits" might be used before it is set

RESOLVED INVALID

Status

()

--
minor
RESOLVED INVALID
16 years ago
16 years ago

People

(Reporter: pkwarren, Unassigned)

Tracking

Trunk
Other
AIX
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
This error is showing up throughout recent builds on AIX. Its looks as if mBits
should be initialized to zero in the constructor.

"/home/tbox/builds/tinderbox/AIX_4.3_Clobber/mozilla/content/html/content/src/../../style/src/nsHTMLAttributes.h",
line 138.9: 1540-1102 (W) "mBits" might be used before it is set.
(Reporter)

Comment 1

16 years ago
Created attachment 119367 [details] [diff] [review]
Patch v1

Initialize mBits to zero in the constructor.
Comment on attachment 119367 [details] [diff] [review]
Patch v1

That patch is incorrect.  This is a *union*.

Is PRWord not the same size as a pointer on AIX?  If so, that would be an NSPR
bug.  Otherwise it's just a bogus warning.
(Reporter)

Comment 3

16 years ago
OK - it does seem to be a invalid warning. PRWord is the correct size on AIX.
Marking invalid per IRC discussion with pkw, who says that PRWord is the correct
size on AIX.

(The AIX compiler is treating this as a union, right?)
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → INVALID
(Reporter)

Comment 5

16 years ago
Yes - it is treating this as a union, it is just giving an invalid warning.
(Reporter)

Comment 6

16 years ago
Comment from our compiler group on the warning message:

"This is valid.  The text of the message says might.  The C and C++ standard
also says it is invalid to access a member of a union that is not the one most
recently stored into."
You need to log in before you can comment on or make changes to this bug.