Closed Bug 68992 Opened 24 years ago Closed 16 years ago

nsMessenger::DoCommand should take const char*, not char*

Categories

(MailNews Core :: Backend, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: bbaetz, Unassigned)

References

()

Details

naving's checkin to nsMessenger broke senna and monkeypox - see the URL for the
patch which was checked in to fix this.

g++ correctly uses the deprecated implicit conversion from a string literal to a
char*, but for the bool?"foo":"bar" case, gcc takes the strings as a const
char*. I have no idea if thats a gcc bug or not - but the online CVS gcc
snapshot (www.codesourcery.com) gave the same error for a simple test case.

All other callers of DoCommand which use the ?: form use a (char*) cast for each
argument. Is there a reason that the 2nd argument to DoCommand doesn't take a
const char*? Its a protected method, and I can't see anything which inherits
from nsMessenger. (If this is done, all the explicit casts should be removed).
The implicit conversion is deprecated, and writing to the constant strings will
probably cause a crash, so this should probably be done anyway.
Yes I had kept const char* but later on got removed by review.
I will be more careful next time. 
Thanks for the checkin. 
Depends on: 68758
So this was fixed? If it was, then mark it fixed.
No, it wasn't fixed. See the dependant bug.
mass re-assign.
Assignee: naving → sspitzer
Product: MailNews → Core
sorry for the spam.  making bugzilla reflect reality as I'm not working on these bugs.  filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody
The call to DoCommand no longer exists, therefore closing invalid.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.