Closed Bug 656282 Opened 9 years ago Closed 9 years ago
Warning C4273 for JS
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.
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)
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.