"ObjectImpl.h(920) : warning C4099: 'JSObject' : type name first seen using 'class' now seen using 'struct'" (and same warning for Shape.h(444))

RESOLVED FIXED in mozilla21

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks: 1 bug)

Trunk
mozilla21
All
Windows 7
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Our windows builds spam tons of warnings like:
{
e:\builds\moz2_slave\m-cen-w32-dbg\build\js\src\vm/ObjectImpl.h(920) : warning C4099: 'JSObject' : type name first seen using 'class' now seen using 'struct'

        e:\builds\moz2_slave\m-cen-w32-dbg\build\js\src\jspubtd.h(192) : see declaration of 'JSObject'
}
...and...
{
e:\builds\moz2_slave\m-cen-w32-dbg\build\js\src\vm/Shape.h(444) : warning C4099: 'JSObject' : type name first seen using 'class' now seen using 'struct'

        e:\builds\moz2_slave\m-cen-w32-dbg\build\js\src\jsobj.h(281) : see declaration of 'JSObject'
}

...for every .cpp file that #includes these headers. (ObjectImpl.h and Shape.h)

Sample log file:
https://tbpl.mozilla.org/php/getParsedLog.php?id=19360674&tree=Firefox

In both cases, it's because we have "friend struct ::JSObject", where everywhere else we refer to JSObject as a class (not a struct).
(Assignee)

Comment 1

5 years ago
Created attachment 709213 [details] [diff] [review]
fix
Attachment #709213 - Flags: review?(dvander)
(Assignee)

Comment 2

5 years ago
For reference, the (correct) declarations of JSObject as a class (not a struct) that the warning message refers to are here:

> 192 class                                       JSObject;
https://mxr.mozilla.org/mozilla-central/source/js/src/jspubtd.h#192

and here:

> 281 class JSObject : public js::ObjectImpl
https://mxr.mozilla.org/mozilla-central/source/js/src/jsobj.h#281

So, this patch makes these 'friend' declarations agree with those on class-vs-struct.
Attachment #709213 - Flags: review?(dvander) → review+
https://hg.mozilla.org/mozilla-central/rev/4e1d18b12979
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.