Closed
Bug 208439
Opened 22 years ago
Closed 22 years ago
MSVC++ .net 2003: nsSupportsArray.cpp(327) compile error
Categories
(Core :: XPCOM, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla1.5alpha
People
(Reporter: ian, Assigned: dbaron)
References
Details
(Whiteboard: [patch])
Attachments
(1 file)
1.23 KB,
patch
|
dbaron
:
review+
jag+mozilla
:
superreview+
|
Details | Diff | Splinter Review |
--------------------------------------------------------------------------------
nsSupportsArray.cpp
e:/Trees\Mozilla.1\mozilla\xpcom\ds\nsSupportsArray.cpp(327) : error C2666: 'ope
rator`!='' : 2 overloads have similar conversions
e:\Trees\Mozilla.1\mozilla\dist\include\xpcom\nsCOMPtr.h(1192): could be
'NSCAP_BOOL operator !=<nsISupports,nsISupports>(const U *,const nsCOMPtr<nsISu
pports> &)'
with
[
U=nsISupports
]
or 'built-in C++ operator!=(nsISupports *, nsISupports *)'
while trying to match the argument list '(nsISupports *, nsCOMPtr<nsISup
ports>)'
note: qualification adjustment (const/volatile) may be causing the ambig
uity
e:/Trees\Mozilla.1\mozilla\xpcom\ds\nsSupportsArray.cpp(605) : warning C4018: '<
' : signed/unsigned mismatch
make[4]: *** [nsSupportsArray.obj] Error 2
--------------------------------------------------------------------------------
Based on dbaron's advice in bug 208320, here's a proposed patch:
Index: nsCOMPtr.h
===================================================================
RCS file: /cvsroot/mozilla/xpcom/glue/nsCOMPtr.h,v
retrieving revision 1.104
diff --unified=4 -d -p -r1.104 nsCOMPtr.h
--- nsCOMPtr.h 3 Jun 2003 03:56:14 -0000 1.104
+++ nsCOMPtr.h 5 Jun 2003 18:08:00 -0000
@@ -1203,9 +1203,9 @@ operator!=( const U* lhs, const nsCOMPtr
// This is defined by an autoconf test, but VC++ also has a bug that
// prevents us from using these. (It also, fortunately, has the bug
// that we don't need them either.)
-#ifdef _MSC_VER
+#if (_MSC_VER < 1310)
#define NSCAP_DONT_PROVIDE_NONCONST_OPEQ
#endif
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
Reporter | ||
Comment 1•22 years ago
|
||
Updated patch based on dbaron's advice:
Index: nsCOMPtr.h
===================================================================
RCS file: /cvsroot/mozilla/xpcom/glue/nsCOMPtr.h,v
retrieving revision 1.104
diff --unified=4 -d -p -r1.104 nsCOMPtr.h
--- nsCOMPtr.h 3 Jun 2003 03:56:14 -0000 1.104
+++ nsCOMPtr.h 5 Jun 2003 18:11:45 -0000
@@ -1203,9 +1203,9 @@ operator!=( const U* lhs, const nsCOMPtr
// This is defined by an autoconf test, but VC++ also has a bug that
// prevents us from using these. (It also, fortunately, has the bug
// that we don't need them either.)
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && (_MSC_VER < 1310)
#define NSCAP_DONT_PROVIDE_NONCONST_OPEQ
#endif
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
Summary: MSVC++ .net 2003: nsSupportsArray.cpp(327) compile error → MSVC++ .net 2003: nsSupportsArray.cpp(327) compile error
Assignee | ||
Comment 2•22 years ago
|
||
For clarity, it might be better to do
#if defined(_MSC_VER) && (_MSC_VER < 1310)
but other than that, r=dbaron.
Taking bug, since I wrote the ifdef in question orginally and I'll get the patch
in...
Assignee: dougt → dbaron
Priority: -- → P2
Whiteboard: [patch]
Target Milestone: --- → mozilla1.5alpha
Assignee | ||
Comment 3•22 years ago
|
||
As an attachment.
Assignee | ||
Updated•22 years ago
|
Attachment #125009 -
Flags: superreview?(jaggernaut)
Attachment #125009 -
Flags: review+
Reporter | ||
Comment 4•22 years ago
|
||
Cool, thanks
Comment 5•22 years ago
|
||
Comment on attachment 125009 [details] [diff] [review]
patch
sr=jag
Attachment #125009 -
Flags: superreview?(jaggernaut) → superreview+
Assignee | ||
Comment 6•22 years ago
|
||
Fix checked in to trunk, 2003-06-05 11:50 -0700. (I guess you could've checked
in it yourself, but I just did anyway...)
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 7•22 years ago
|
||
what version of the cl are you using. I am using msvc+ .net and do not have any
such problem:
cl --version
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Assignee | ||
Comment 8•22 years ago
|
||
dougt: more importantly, what does your compiler define _MSC_VER as?
Reporter | ||
Comment 9•22 years ago
|
||
dougt: I'm using 13.10.3077. You're using the 2002 version of .net, I'm using
the 2003 version, as per the bug's summary.
dbaron: So it turns out the _MSC_VER define is the first two numbers of the
compiler version stuck together, and the compiler version is independent of the
IDE's version.
Comment 10•22 years ago
|
||
The .NET 2002 version is:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86
I'm not sure where version 12.x comes from. Maybe MSVC++ 6.0?
Assignee | ||
Comment 11•22 years ago
|
||
1200 is VC++ 6.0. 1100 is VC++ 5.0.
You need to log in
before you can comment on or make changes to this bug.
Description
•