Closed Bug 449438 Opened 12 years ago Closed Last year

[xpidl] Generated forward macros have issues with [notxpcom]


(Core :: XPCOM, defect, minor)

Not set





(Reporter: dbradley, Assigned: dbradley)



The XPIDL compiler does not generate proper implementations for notxpcom functions. It assumes that the function returns an nsresult value which is not always the case.

The tricky issue is that for non-nsresult types for the "safe" version what do we return in the not safe branch? One object is to return default constructed value.

Another option is to just not generate forward implementations for [notxpcom] methods.

Lastly we could just leave it like it is. The down side there is that Windows doesn't fail, but other platforms fail at compile time. So you can be lulled into thinking that things are fine on Windows and get burned on other platforms.

I'd kind of lean to just not providing forwards for such functions since we can't do it cleanly for all cases. And I don't think that would break any existing code since it would be failing to compile on Mac and other platforms. So the only risk might be some Windows only code that has slipped through.
This seems to be fixed now.  We generate the forwards correctly.  For the "safe" version we generate a declaration but not an implementation, which will at least fail at link time.   That last was fixed in bug 779809.
Closed: Last year
Depends on: 779809
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.