Closed Bug 7610 Opened 26 years ago Closed 25 years ago

SetFoo generated by 'attribute string foo' should be const.

Categories

(Core :: XPCOM, defect, P3)

SGI
IRIX
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: mike+mozilla, Assigned: mike+mozilla)

References

Details

From an email from John Bandhauer: Warren Harris wrote: > > John, > > I've noticed that if you declare: attribute string foo; > You get GetFoo(char* *result) and SetFoo(char* value) > But shouldn't SetFoo take a const char*, forcing the callee to > copy? > Other 'in string' parameters translate to const char* args. > > Warren Yes, this makes sense to me. I simply forgot about attributes it when I added the constness for 'in' string params. Can whichever one of you Mikes that is owning xpidl fix this? Let's review what we have and nail this. We'll have to carpool in the change if there is a bunch of code that will be touched. The pointer types that we support are string, wstring, and nsid. We don't want to add constaness for interface pointer params. John. Sounds good; we should take a look at making this change. However, if it requires any changes to existing .idl, we need to be very careful. Because the Mac xpidl isn't built as part of the build process, we don't have the option of making synchronous changes to both the xpidl compiler and all .idl uses (as we do with the unix and windows versions.) The best option I can think of for making this kind of changeover is to add an invocation option to the xpidl compiler that controls this behavior, making sure it's fully distributed, then changing the uses synchronously with using the invocation option. _then_ we can eventually remove the option. Any better ideas?
*** Bug 7872 has been marked as a duplicate of this bug. ***
I can help do the mail/news IDL switchover when it happens. Let me know.
Status: NEW → ASSIGNED
Patrick Beard just informed me that xpidl will soon be part of the build process on the Mac. This means that we can synchronously change xpidl and files compiled against the generated .h files without having a carpool for the mac. Yay! As soon as that happens, fixing this bug should be much much easier. Changing status to assigned.
*** Bug 11621 has been marked as a duplicate of this bug. ***
*** Bug 12011 has been marked as a duplicate of this bug. ***
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Fix to xpidl_header.h, plus massive tree spam to fix all uses, checked in.
Component: xpidl → XPCOM
QA Contact: mike+mozilla → xpcom
You need to log in before you can comment on or make changes to this bug.