Closed
Bug 243130
Opened 21 years ago
Closed 21 years ago
nsLocalMailFolder.cpp: Cannot assign const char* to char*
Categories
(MailNews Core :: Backend, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mozbugs, Assigned: Bienvenu)
Details
Attachments
(1 file)
659 bytes,
patch
|
timeless
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040507 Firefox/0.8.0+
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040507 Firefox/0.8.0+
Can't build mozilla or tunderbird from the trunk on Solaris with Sun Studio
compiler:
"nsLocalMailFolder.cpp", line 3032: Error: Cannot assign const char* to char*.
"nsLocalMailFolder.cpp", line 3055: Error: Cannot assign const char* to char*.
2 Error(s) detected.
gmake[5]: *** [nsLocalMailFolder.o] Error 2
gmake[5]: Leaving directory
`/export/stuff/mozilla/mozilla-20040508/mozilla/mailnews/local/src'
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Couldn't see an applicable component under mailnews for this ???
Reporter | ||
Updated•21 years ago
|
OS: other → Solaris
Hardware: Other → Sun
Comment 2•21 years ago
|
||
so, this got added as part of:
1.456 <bienvenu@nventure.com> 2004-05-08 08:35
But _why_ does strstr return a constant string??
Updated•21 years ago
|
Assignee: general → sspitzer
Component: Browser-General → Mail Back End
Product: Browser → MailNews
QA Contact: general
Assignee | ||
Comment 3•21 years ago
|
||
this should fix it...
Assignee: sspitzer → bienvenu
Status: UNCONFIRMED → ASSIGNED
Assignee | ||
Updated•21 years ago
|
Attachment #148070 -
Flags: superreview?(sspitzer)
Comment on attachment 148070 [details] [diff] [review]
proposed fix
the reason it returns a constant string is that strstr can take a constant
string as input :).
#define STRSTR(haystack, needle) (haystack+(strstr(haystack,
needle)-haystack)).
The better question is why do some clibraries return a non const string?
the result is this compiling code:
#include <string.h>
#include <stdio.h>
const char readonly[]="read only\n"; const char crash[]="crash";
int main(void){
char *crashonly; const char *crasher;
crashonly=strstr(readonly,"r"); crasher=crash;
do { *crashonly++=*crasher++; } while(*crasher);
puts(readonly); return 0;
}
Attachment #148070 -
Flags: review+
Comment 5•21 years ago
|
||
(In reply to comment #3)
> Created an attachment (id=148070)
> proposed fix
>
> this should fix it...
Confirmed with mozilla trunk and thunderbird trunk builds.
Assignee | ||
Updated•21 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Attachment #148070 -
Flags: superreview?(sspitzer)
Updated•20 years ago
|
Product: MailNews → Core
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•