Closed
Bug 129533
Opened 23 years ago
Closed 23 years ago
|Cannot use const char* to initialize char*| bustage
Categories
(SeaMonkey :: Build Config, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: roland.mainz, Assigned: netscape)
References
Details
Attachments
(2 files, 1 obsolete file)
5.05 KB,
patch
|
karnaze
:
review+
darin.moz
:
superreview+
asa
:
approval+
|
Details | Diff | Splinter Review |
781 bytes,
patch
|
roland.mainz
:
review+
asa
:
approval+
|
Details | Diff | Splinter Review |
2002-03-06-08-trunk build with Sun Workshop 7EA2. The build breaks due some |Cannot use const char* to initialize char*| errors in the code ("nebiros" is gone from the Seamonkey-Ports page, there is no RED tinderbox but it will be RED once it's "up" again...) ...
Reporter | ||
Comment 1•23 years ago
|
||
Comment 2•23 years ago
|
||
Looks fine, r=/sr=jag. Darin, what do you think?
Comment 3•23 years ago
|
||
Comment on attachment 73017 [details] [diff] [review] Patch for 2002-03-06-08-trunk sr=darin
Attachment #73017 -
Flags: superreview+
Updated•23 years ago
|
Attachment #73017 -
Flags: review+
Assignee | ||
Comment 4•23 years ago
|
||
*** Bug 129619 has been marked as a duplicate of this bug. ***
Comment 5•23 years ago
|
||
Comment on attachment 73017 [details] [diff] [review] Patch for 2002-03-06-08-trunk a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #73017 -
Flags: approval+
Assignee | ||
Comment 6•23 years ago
|
||
Patch has been checked in
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
nsMsgUtils.cpp also has the same problem. "nsMsgUtils.cpp", line 416: Error: Cannot use const char* to initialize 416 and 410 line: ------------------------- char*. if (s != decodedString.get()) { // extract between "=?" and "?" // e.g. =?ISO-2022-JP? ->416 char *p1 = strstr(*stringP, "=?"); if (p1) { p1 += sizeof("=?")-1; // skip "=?" ->420 char *p2 = strchr(p1, '?'); // then search for '?' if (p2) { char charset[kMAX_CSNAME] = ""; ----------------------------
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reporter | ||
Comment 9•23 years ago
|
||
Comment on attachment 73452 [details] [diff] [review] nsMsgUtils.cpp r=Roland.Mainz@informatik.med.uni-giessen.de
Attachment #73452 -
Flags: review+
Comment 10•23 years ago
|
||
taking a guess that this is related to the problem I filed about it: bug 129994.
Comment 11•23 years ago
|
||
shouldn't use strstr function,we should usr PL_strstr,it will let mozilla build ok on sun Platform.
Reporter | ||
Comment 12•23 years ago
|
||
Antonio.Xu wrote:
> shouldn't use strstr function, we should usr PL_strstr, it will let mozilla
> build ok on sun Platform.
Well, then the prototype for PL_strstr() is wrong and should be fixed. And then
we have the same problem...
BTW: We should always use the OS native functions if possible and available,
they are usually better optimised and/or |inline| or compiler buildins
(currently we are slaughtering most stuff in nsCRT::* for that reason...) ...
Comment 13•23 years ago
|
||
i'm 80% certain strstr isn't available from all c libraries, so for now, please use the PL_ version and contact nspr about any prototype issues.
Comment 14•23 years ago
|
||
timeless, see: netwerk/protocol/data/src/nsDataChannel.cpp: char *buffer = strstr(spec.get(), "data:"); netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp: char* eol = strstr(currLine, CRLF); so, i think strstr should be ok to use.
Comment 15•23 years ago
|
||
See Kernighan and Ritchie, The C Programming Language, 2nd. Ed., page 250. The function strstr() is documented.
Comment 16•23 years ago
|
||
Comment on attachment 73452 [details] [diff] [review] nsMsgUtils.cpp a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #73452 -
Flags: approval+
Assignee | ||
Comment 17•23 years ago
|
||
Patch checked in.
Status: REOPENED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → FIXED
Comment 18•22 years ago
|
||
This has just (approximately 3/30/02) shown up in a new spot
mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp
suggest the following fix
485c485
< char* eol = strstr(currLine, CRLF);
---
> char* eol = (char *) strstr(currLine, CRLF);
Comment 19•22 years ago
|
||
no. patch coming up
Comment 20•22 years ago
|
||
Comment 21•22 years ago
|
||
Comment on attachment 76965 [details] [diff] [review] correct fix for bbaetz's r=bryner
Attachment #76965 -
Flags: review+
Comment 22•22 years ago
|
||
Comment on attachment 76965 [details] [diff] [review] correct fix for bbaetz's sr=darin
Attachment #76965 -
Flags: superreview+
Comment 23•22 years ago
|
||
Seeing this problem on todays Sun Solaris cvs "nsFtpConnectionThread.cpp" , line 485: Error: Cannot use const char* to initialize char*. Lets get this checked in so I can start getting Solaris dailys built and tested again. Thanks Donnie -dcran-
Comment 24•22 years ago
|
||
Comment on attachment 76965 [details] [diff] [review] correct fix for bbaetz's checked in a=asa
Attachment #76965 -
Attachment is obsolete: true
Attachment #76965 -
Flags: approval+
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•