Closed Bug 656282 Opened 10 years ago Closed 9 years ago

Warning C4273 for JS_Assert

Categories

(Core :: JavaScript Engine, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dmandelin, Unassigned)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Currently getting a big spew of this on MSVC builds:

e:\sources\tracemonkey\js\src\jsutil.h(59) : warning C4273: 'JS_Assert' : inconsistent dll linkage
        e:\sources\tracemonkey\js\src\debug\dist\include\mozilla/Util.h(59) : see previous definition of 'JS_Assert'
testSameValue.cpp
The problem here is that (at least) the Makefile.in's of js/src/shell and js/src/jsapi-tests are using |DEFINES += -DEXPORT_JS_API| even though they don't export jsapi symbols.  This causes JS_Assert to be declared dllexport instead of dllimport as it should be.  mfbt piggy-backs on JS_EXPORT but has a separate switch for exporting vs. importing symbols.

The fix is to remove -DEXPORT_JS_API from where it doesn't belong.
Attached patch PatchSplinter Review
Removing -DEXPORT_JS_API from the submakefiles doesn't work--it produces a lot of warnings about stuff being imported.

I didn't check into exactly why that is, because it seems to me that not making duplicate definitions that use different macrology that has to be carefully synchronized seems like the better fix.
Attachment #532789 - Flags: review?(jorendorff)
Attachment #532789 - Flags: review?(jorendorff) → review?(luke)
Attachment #532789 - Flags: review?(luke) → review+
http://hg.mozilla.org/tracemonkey/rev/64cd255ac851
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/64cd255ac851
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.