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



MailNews Core
17 years ago
10 years ago


(Reporter: Bradley Baetz, Unassigned)


Firefox Tracking Flags

(Not tracked)





17 years ago
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.

Comment 1

17 years ago
Yes I had kept const char* but later on got removed by review.
I will be more careful next time. 
Thanks for the checkin. 


17 years ago
Depends on: 68758

Comment 2

17 years ago
So this was fixed? If it was, then mark it fixed.

Comment 3

17 years ago
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.
Last Resolved: 10 years ago
Resolution: --- → INVALID


10 years ago
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.