Closed Bug 168790 Opened 22 years ago Closed 13 years ago

Illegal C statement generated for nsIXmlRpcClient::createType in nsIXmlRpcClient.idl

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE
mozilla1.7alpha

People

(Reporter: yjwang, Assigned: dbradley)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Build Identifier: Mozilla 1.0

The interface nsIXmlRpcClient which is declared in file mozilla/extensions/xml-
rpc/idl/nsIXmlRpcClient.idl has a method createType. The signature of this 
method is void createType(in unsigned long type, out nsIIDRef uuid, out 
nsQIResult result). XPIDL will generate .h file like createType(..., IID& 
*uuid, ...). But a pointer to reference is illegal in C/C++.

Reproducible: Always

Steps to Reproduce:
Just use XPIDL to compile file mozilla/extensions/xml-
rpc/idl/nsIXmlRpcClient.idl. It will produce C header file with illegal C 
statement.
Actual Results:  
I modified file mozilla/extensions/xml-rpc/idl/nsIXmlRpcClient.idl to let 
method createType with signature void createType(in unsigned long type, out 
nsIIDPtr uuid, out nsQIResult result).


This maybe the bug of XPIDL compiler. It should not produce pointer to 
reference for something like 'out nsIIDRef uuid'.
This is an issue. I see two options, handle this, or generate an error. We
currently handle AStringRef and other strings as special cases. I'm thinking we
should extend this support to any "ref" type.
Status: UNCONFIRMED → NEW
Ever confirmed: true
This should generate an error.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.4beta
Moving out
Target Milestone: mozilla1.4beta → mozilla1.5alpha
Moving out
Target Milestone: mozilla1.5alpha → mozilla1.6alpha
Moving out
Target Milestone: mozilla1.6alpha → mozilla1.7alpha
Component: xpidl → XPCOM
QA Contact: pschwartau → xpcom
I believe the original statement is invalid; everyone on IRC is pretty certain that a pointer to a ref is valid C++.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
>I believe the original statement is invalid; everyone on IRC is pretty certain 
>that a pointer to a ref is valid C++.

I guess "everyone on IRC" is pretty certain the earth is flat, too?

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3092.pdf

8.3.1/4: [Note: there are no pointers to references: see 8.3.2. ...]
8.3.2/4 says: There shall be no references to references, no arrays of references, and no pointers to references. ..

C++11 is the same. The standard even explains why this is unlikely to change (bitfields).
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Well, in any event, the offending file no longer exists in the tree.
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.