Closed Bug 302456 Opened 20 years ago Closed 20 years ago

nsVersionComparator.cpp fails to compile due to missing/incorrect casting

Categories

(Core :: XPCOM, defect)

Sun
Solaris
defect
Not set
blocker

Tracking

()

RESOLVED DUPLICATE of bug 303185

People

(Reporter: Mitch, Unassigned)

Details

(Keywords: helpwanted)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8b2) Gecko/20050706 Firefox/1.0+ Build Identifier: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8b2) Gecko/20050706 Firefox/1.0+ Sun's C++ compiler throws the following error on compiling xpocm's nsVersionComparator.cpp Building deps for nsVersionComparator.cpp /share/lang/i386/10/SUNWspro/bin/CC -o nsVersionComparator.o -c -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DBUILD_ID=2005072807 -I./../build -I../../dist/include/string -I../../dist/include/xpcom -I../../dist/include -I../../dist/include/nspr -I../../dist/sdk/include -KPIC -xbuiltin=%all -features=tmplife -mt -DNDEBUG -DTRIMMED -xO4 -DMOZILLA_VERSION=\"1.8b4\" -DMOZILLA_VERSION_MAJOR=1 -DMOZILLA_VERSION_MINOR=8 -DSOLARIS=1 -DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DD_INO=d_ino -DSTDC_HEADERS=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_SIGINFO_T=1 -DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_INT64_T=1 -DHAVE_UINT=1 -DHAVE_UINT_T=1 -DHAVE_UINT16_T=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_BYTEORDER_H=1 -DHAVE_GETOPT_H=1 -DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_NL_TYPES_H=1 -DHAVE_MALLOC_H=1 -DHAVE_X11_XKBLIB_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_LIBM=1 -DHAVE_LIBDL=1 -DHAVE_LIBSOCKET=1 -DFUNCPROTO=15 -DHAVE_XSHM=1 -D_REENTRANT=1 -DHAVE_RANDOM=1 -DHAVE_STRERROR=1 -DHAVE_LCHOWN=1 -DHAVE_FCHMOD=1 -DHAVE_SNPRINTF=1 -DHAVE_MEMMOVE=1 -DHAVE_RINT=1 -DHAVE_STAT64=1 -DHAVE_LSTAT64=1 -DHAVE_FLOCKFILE=1 -DHAVE_LOCALTIME_R=1 -DHAVE_STRTOK_R=1 -DHAVE_LANGINFO_CODESET=1 -DVA_COPY=va_copy -DHAVE_VA_COPY=1 -DHAVE_I18N_LC_MESSAGES=1 -DMOZ_DEFAULT_TOOLKIT=\"gtk2\" -DMOZ_WIDGET_GTK2=1 -DMOZ_ENABLE_XREMOTE=1 -DMOZ_X11=1 -DMOZ_PHOENIX=1 -DMOZ_BUILD_APP=browser -DMOZ_XUL_APP=1 -DMOZ_DISTRIBUTION_ID=\"org.mozilla\" -DMOZ_ENABLE_XFT=1 -DMOZ_ENABLE_GNOMEUI=1 -DOJI=1 -DIBMBIDI=1 -DMOZ_VIEW_SOURCE=1 -DACCESSIBILITY=1 -DMOZ_XPINSTALL=1 -DMOZ_JSLOADER=1 -DMOZ_XTF=1 -DHAVE_GSSAPI_GSSAPI_H=1 -DMOZ_MATHML=1 -DNS_DISABLE_LOGGING=1 -DMOZ_USER_DIR=\".mozilla\" -DMOZ_XUL=1 -DMOZ_PROFILELOCKING=1 -DMOZ_DLL_SUFFIX=\".so\" -DXP_UNIX=1 -DUNIX_ASYNC_DNS=1 -DJS_THREADSAFE=1 -DNS_PRINT_PREVIEW=1 -DNS_PRINTING=1 -DMOZ_ACCESSIBILITY_ATK=1 -DMOZILLA_LOCALE_VERSION=\"1.8b2\" -DMOZILLA_REGION_VERSION=\"1.8b2\" -DMOZILLA_SKIN_VERSION=\"1.5\" -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT nsVersionComparator.cpp "nsVersionComparator.cpp", line 83: Error: Cannot use const char* to initialize char*. 1 Error(s) detected. gmake[4]: *** [nsVersionComparator.o] Error 1 gmake[4]: Leaving directory `/share/bld/u/scratch/mitch/mozilla/firefox/mozilla/xpcom/glue' gmake[3]: *** [libs] Error 2 gmake[3]: Leaving directory `/share/bld/u/scratch/mitch/mozilla/firefox/mozilla/xpcom' gmake[2]: *** [tier_2] Error 2 gmake[2]: Leaving directory `/share/bld/u/scratch/mitch/mozilla/firefox/mozilla' gmake[1]: *** [default] Error 2 gmake[1]: Leaving directory `/share/bld/u/scratch/mitch/mozilla/firefox/mozilla' gmake: *** [build] Error 2 Reproducible: Always Steps to Reproduce: 1. Build Mozilla 2. 3. Actual Results: Build failed
Assignee: nobody → dougt
Status: UNCONFIRMED → NEW
Component: Build Config → XPCOM
Ever confirmed: true
Product: Mozilla Application Suite → Core
QA Contact: build-config → xpcom
Version: unspecified → Trunk
Same for VS.NET 2005 Beta2 x:/Mozilla/mozilla/xpcom/glue/nsVersionComparator.cpp(83) : error C2440: 'initializing' : cannot convert from 'const char *' to 'char *' Conversion loses qualifiers make[4]: *** [nsVersionComparator.obj] Error 2
how is strpbrk defined on your system? char *strpbrk(const char *s1, const char *s2);
-> bsmedberg strchr and friends return |const char*| on some platforms.
Assignee: dougt → benjamin
I already reworked the const issues once before attaching the original patch, so I would appreciate it if somebody who experiences this brokenness could attach a patch which works for them.
Keywords: helpwanted
Assignee: benjamin → nobody
Attached patch Proposed patchSplinter Review
This one works for me on VS2005 Beta 2. Please note that change in nsXPCOMGlue.cpp is also required.
Attachment #191515 - Flags: review?(dougt)
Attachment #191515 - Flags: review?(dougt) → review?(benjamin)
Comment on attachment 191515 [details] [diff] [review] Proposed patch It seems to me that you could just use const char* instead of the cast... I think darin already reviewed a patch which changed nsVersionComparator to use the const char notation.
Attachment #191515 - Flags: review?(benjamin) → review-
(In reply to comment #7) > (From update of attachment 191515 [details] [diff] [review] [edit]) > It seems to me that you could just use const char* instead of the cast... I > think darin already reviewed a patch which changed nsVersionComparator to use > the const char notation. You're right, that's bug 303185. And there also is one for nsXPCOMGlue.cpp: bug 303186
*** This bug has been marked as a duplicate of 303185 ***
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: