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

RESOLVED INVALID

Status

MailNews Core
Backend
RESOLVED INVALID
17 years ago
10 years ago

People

(Reporter: Bradley Baetz, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

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. 

Updated

17 years ago
Depends on: 68758

Comment 2

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

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.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → INVALID
(Assignee)

Updated

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