Closed
Bug 291861
Opened 20 years ago
Closed 20 years ago
XPCDispInterface.cpp fails to compile with Microsoft Visual Studio 2005 Beta 2
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: stdowa+bugzilla, Assigned: dbradley)
References
Details
Attachments
(1 file, 1 obsolete file)
|
3.35 KB,
patch
|
shaver
:
review+
shaver
:
approval1.8b2+
|
Details | Diff | Splinter Review |
c:/Mozilla/mozilla/js/src/xpconnect/src/XPCDispInterface.cpp(183) : error C2664:
'JS_InternUCStringN' : cannot convert parameter 2 from 'BST
R' to 'const jschar *'
Types pointed to are unrelated; conversion requires reinterpret_cast,
C-style cast or function-style cast
Comment 1•20 years ago
|
||
I think that the real fix would be to change jschar definition in
js\src\jspubtd.h to: "typedef wchar_t jschar;" (same as PRUnichar definition)
If it is not possible to change the definition then just cast to (const jschar *) ?
Comment 2•20 years ago
|
||
We should NS_STATIC_CAST here, just as we do elsewhere.
Comment 3•20 years ago
|
||
Re: comment 2: absolutely not, jschar is uint16 per ECMA-262 Edition 3.
/be
Comment 4•20 years ago
|
||
Brendan meant the wchar_t change at comment 1; he has trouble with numbers
sometimes.
| Reporter | ||
Comment 5•20 years ago
|
||
Attachment #182649 -
Flags: review?(shaver)
Comment 6•20 years ago
|
||
I think that the cast in XPCDispTypeInfo.cpp should be:
- mName = nsString(chars, len);
+ mName = nsString(NS_REINTERPRET_CAST(const PRUnichar *, chars), len);
About all those casts, I think that it's because of this compiler change:
(from http://msdn2.microsoft.com/library/ms177253(en-us,vs.80).aspx)
/Zc:wchar_t now on by default
This is Standard C++ behavior: A wchar_t variable will default to the built
in type instead of a short unsigned integer. This change will break binary
compatibility when client code is linked with libraries that were compiled
without /Zc:wchar_t. Use /Zc:wchar_t- to revert to the old, non-standard
behavior. This change was introduced to create conformant code by default.
I don't really understand the binary compatibility problem, though...
See also, fwiw, this can break things:
/Zc:forScope now on by default
This is Standard C++ behavior: Code that depends on the use of a variable
declared in a for loop after the for loop scope has ended will now fail to
compile. Use /Zc:forScope- to revert to the old, non-standard behavior. This
change was introduced to create conformant code by default.
Comment 7•20 years ago
|
||
Comment on attachment 182649 [details] [diff] [review]
Cast until it compiles
r+a again, more compiler fixes.
Attachment #182649 -
Flags: review?(shaver)
Attachment #182649 -
Flags: review+
Attachment #182649 -
Flags: approval1.8b2+
| Reporter | ||
Comment 8•20 years ago
|
||
Attachment #182649 -
Attachment is obsolete: true
| Reporter | ||
Updated•20 years ago
|
Attachment #182649 -
Flags: approval1.8b2+
Comment 9•20 years ago
|
||
Comment on attachment 182656 [details] [diff] [review]
Cast to const PRUnichar * instead
Yeah, that's better. Thanks for checking in, r+a.
Attachment #182656 -
Flags: review+
Attachment #182656 -
Flags: approval1.8b2+
| Reporter | ||
Comment 10•20 years ago
|
||
checked in by db48x
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•