Closed Bug 90366 Opened 24 years ago Closed 24 years ago

xpidl-generated code produces preprocessor warnings

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
minor

Tracking

()

VERIFIED FIXED
mozilla0.9.4

People

(Reporter: ahc4, Assigned: dbradley)

Details

Attachments

(1 file)

When xpidl generates the _FORWARD macros, it uses preprocessor concatenation to join _to and the actual method call. On newer versions of gcc (at least the version with Red Hat 7.1), the preprocessor spits out a warning, since joining the two doesn't produce a valid token. Removing all occurrences of ## in xpidl.c fixes this, and everything still builds fine, but I don't know what it would do on other compilers, since it leaves a space between the first part and the method name. I believe that inserting a space, as in "MyClass:: MyMethod()" or "myobject-> MyMethod()" is just as valid C++ as without the space, but I'm not sure. This isn't that big a deal, but warnings are annoying, particularly when they're in autogenerated code.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Honestly I don't know why the ## operator was used here. AFAICT it's not needed. My fear is that some compiler out there, choked without it. McCabe put it in back in version 1.61. Unfortunately he only stated he put it in and not why. I'm adding shaver and jband in case they might recall why it was needed.
Status: NEW → ASSIGNED
You should say how you've tested this. I assume you've done a full clobber build on NT and everything was fine. That would indicate that this is more likely than not to work everywhere. Assuming you tested, then r/sr=jband. It looks right to me.
Yes, I did clobber builds on Win2k and Linux and all was fine.
I'll check this on the Mac build.
Target Milestone: --- → mozilla0.9.3
Moving out.
Target Milestone: mozilla0.9.3 → mozilla0.9.4
The Mac build works fine with this patch in place.
sr=scc
r=jst
patch checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Marking Verified -
Status: RESOLVED → VERIFIED
Component: xpidl → XPCOM
QA Contact: pschwartau → xpcom
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: