Closed Bug 7206 Opened 25 years ago Closed 25 years ago

ANSI C++ violation

Categories

(MailNews Core :: Database, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: bruce, Assigned: davidmc)

References

Details

Current build on May 26, 1999 (5-6pm PDT).

Several here:

     aCC -ext -o orkinHeap.o -c   -DUSE_AUTOCONF=1 -DMOZILLA_CLIENT=1
-DSTDC_HEADERS=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_ST_RDEV=1 -DHAVE_TZNAME=1
-DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_UINT=1 -DHAVE_UINT16_T=1
-DHAVE_DIRENT_H=1 -DHAVE_SYS_WAIT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_FCNTL_H=1
-DHAVE_LIMITS_H=1 -DHAVE_MALLOC_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_SYS_FILE_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_TIME_H=1
-DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_VFS_H=1 -DHAVE_SYS_MOUNT_H=1 -DHAVE_LIBC_R=1
-DHAVE_LIBM=1 -DHAVE_LIBL=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_UNISTD_H=1
-DHAVE_GETPAGESIZE=1 -DRETSIGTYPE=void -DHAVE_STRCOLL=1 -DHAVE_STRFTIME=1
-DHAVE_UTIME_NULL=1 -DHAVE_VPRINTF=1 -DHAVE_FTIME=1 -DHAVE_GETCWD=1
-DHAVE_GETHOSTNAME=1 -DHAVE_GETWD=1 -DHAVE_MKDIR=1 -DHAVE_MKTIME=1
-DHAVE_PUTENV=1 -DHAVE_RMDIR=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_STRCSPN=1
-DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_STRSPN=1 -DHAVE_STRSTR=1
-DHAVE_STRTOL=1 -DHAVE_STRTOUL=1 -DHAVE_UNAME=1 -DHAVE_QSORT=1 -!
     DHAVE_WAI
     TID=1 -DHAVE_REMAINDER=1 -DHAVE_LCHOWN=1 -DHAVE_STATVFS=1
-DHAVE_LOCALTIME_R=1 -DHAVE_SETVBUF=1 -DHAVE_GETTIMEOFDAY=1
-DGETTIMEOFDAY_TWO_ARGS=1 -DHAVE_IOS_BINARY=1 -DHAVE_CPP_EXPLICIT=1
-DHAVE_I18N_LC_MESSAGES=1 -DENABLE_PICS=1 -DMOZ_USER_DIR=\".mozilla\"
-DMOZ_DLL_SUFFIX=sl -DMODULAR_NETLIB=1 -DSTANDALONE_IMAGE_LIB=1 -DXP_UNIX=1
-DUNIX_EMBED=1 -DX_PLUGINS=1 -DUNIX_LDAP=1 -DUNIX_ASYNC_DNS=1 -DJS_THREADSAFE=1
-DLAYERS=1 -DNETSCAPE=1 -DNGEDITOR=1  -g +Z  -DDEBUG -UNDEBUG -DDEBUG_cltbld
-DTRACING -DOSTYPE=\"HP-UXB.10\" -DSingleSignon -DCookieManagement
-DClientWallet  -I../../../../dist/./include -I../../../../dist/include
-I../../../../../include -I/builds/tinderbox/SeaMonkey/nspr/include
-I../../../../dist/./public/jpeg -I../../../../dist/./public/png
-I../../../../dist/./public/zlib  -I/usr/include/X11
../../../../../mailnews/db/mork/src/orkinHeap.cpp
     Error (future) 250: "../../../../../mailnews/db/mork/src/orkinHeap.cpp",
line 72 # An object cannot be deleted using a pointer of type 'void *' since the
type of the object allocated is unknown. Either delete the object using the
allocated type or call operator delete directly.
             delete [] inBlock;
                       ^^^^^^^
NEXT Warning:   1 future errors were detected and ignored. Add a '+p' option to
detect and fix them before they become fatal errors in a future release.
Behavior of this ill-formed program is not guaranteed to match that of a
well-formed program

     aCC -ext -o nsMsgDatabase.o -c   -DUSE_AUTOCONF=1 -DMOZILLA_CLIENT=1
-DSTDC_HEADERS=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_ST_RDEV=1 -DHAVE_TZNAME=1
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MOZ_USER_DIR=\".mozilla\"
-DMOZ_DLL_SUFFIX=sl -DMODULAR_NETLIB=1 -DSTANDALONE_IMAGE_LIB=1 -DXP_UNIX=1
-DUNIX_EMBED=1 -DX_PLUGINS=1 -DUNIX_LDAP=1 -DUNIX_ASYNC_DNS=1 -DJS_THREADSAFE=1
-DLAYERS=1 -DNETSCAPE=1 -DNGEDITOR=1  -g +Z  -DDEBUG -UNDEBUG -DDEBUG_cltbld
-DTRACING -DOSTYPE=\"HP-UXB.10\" -DSingleSignon -DCookieManagement
-DClientWallet  -I../../../../dist/./include -I../../../../dist/include
-I../../../../../include -I/builds/tinderbox/SeaMonkey/nspr/include
-I../../../../dist/./public/jpeg -I../../../../dist/./public/png
-I../../../../dist/./public/zlib  -I/usr/include/X11
../../../../../mailnews/db/msgdb/src/nsMsgDatabase.cpp
     Error (future) 250:
"../../../../../mailnews/db/msgdb/src/nsMsgDatabase.cpp", line 1880 # An object
cannot be deleted using a pointer of type 'void *' since the type of the object
allocated is unknown. Either delete the object using the allocated type or call
operator delete directly.
                         delete[] yarn.mYarn_Buf;        // won't need this when
we have nsCString
                                  ^^^^^^^^^^^^^^
     Error (future) 250:
"../../../../../mailnews/db/msgdb/src/nsMsgDatabase.cpp", line 1883 # An object
cannot be deleted using a pointer of type 'void *' since the type of the object
allocated is unknown. Either delete the object using the allocated type or call
operator delete directly.
                         delete[] yarn.mYarn_Buf;        // won't need this when
we have nsCString
                                  ^^^^^^^^^^^^^^
     Error (future) 250:
"../../../../../mailnews/db/msgdb/src/nsMsgDatabase.cpp", line 1886 # An object
cannot be deleted using a pointer of type 'void *' since the type of the object
allocated is unknown. Either delete the object using the allocated type or call
operator delete directly.
                         delete[] yarn.mYarn_Buf;        // won't need this when
we have nsCString
                                  ^^^^^^^^^^^^^^
     Error (future) 250:
"../../../../../mailnews/db/msgdb/src/nsMsgDatabase.cpp", line 1889 # An object
cannot be deleted using a pointer of type 'void *' since the type of the object
allocated is unknown. Either delete the object using the allocated type or call
operator delete directly.
                         delete[] yarn.mYarn_Buf;        // won't need this when
we have nsCString
                                  ^^^^^^^^^^^^^^
     Error (future) 250:
"../../../../../mailnews/db/msgdb/src/nsMsgDatabase.cpp", line 1892 # An object
cannot be deleted using a pointer of type 'void *' since the type of the object
allocated is unknown. Either delete the object using the allocated type or call
operator delete directly.
                         delete[] yarn.mYarn_Buf;        // won't need this when
we have nsCString
                                  ^^^^^^^^^^^^^^
NEXT Warning:   5 future errors were detected and ignored. Add a '+p' option to
detect and fix them before they become fatal errors in a future release.
Behavior of this ill-formed program is not guaranteed to match that of a
well-formed program


     aCC -ext -o nsDBFolderInfo.o -c   -DUSE_AUTOCONF=1 -DMOZILLA_CLIENT=1
-DSTDC_HEADERS=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_ST_RDEV=1 -DHAVE_TZNAME=1
-DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_UINT=1 -DHAVE_UINT16_T=1
-DHAVE_DIRENT_H=1 -DHAVE_SYS_WAIT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_FCNTL_H=1
-DHAVE_LIMITS_H=1 -DHAVE_MALLOC_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_SYS_FILE_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_TIME_H=1
-DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_VFS_H=1 -DHAVE_SYS_MOUNT_H=1 -DHAVE_LIBC_R=1
-DHAVE_LIBM=1 -DHAVE_LIBL=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_UNISTD_H=1
-DHAVE_GETPAGESIZE=1 -DRETSIGTYPE=void -DHAVE_STRCOLL=1 -DHAVE_STRFTIME=1
-DHAVE_UTIME_NULL=1 -DHAVE_VPRINTF=1 -DHAVE_FTIME=1 -DHAVE_GETCWD=1
-DHAVE_GETHOSTNAME=1 -DHAVE_GETWD=1 -DHAVE_MKDIR=1 -DHAVE_MKTIME=1
-DHAVE_PUTENV=1 -DHAVE_RMDIR=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_STRCSPN=1
-DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_STRSPN=1 -DHAVE_STRSTR=1
-DHAVE_STRTOL=1 -DHAVE_STRTOUL=1 -DHAVE_UNAME=1 -DHAVE_QSOR!
     T=1 -DHAV
     E_WAITID=1 -DHAVE_REMAINDER=1 -DHAVE_LCHOWN=1 -DHAVE_STATVFS=1
-DHAVE_LOCALTIME_R=1 -DHAVE_SETVBUF=1 -DHAVE_GETTIMEOFDAY=1
-DGETTIMEOFDAY_TWO_ARGS=1 -DHAVE_IOS_BINARY=1 -DHAVE_CPP_EXPLICIT=1
-DHAVE_I18N_LC_MESSAGES=1 -DENABLE_PICS=1 -DMOZ_USER_DIR=\".mozilla\"
-DMOZ_DLL_SUFFIX=sl -DMODULAR_NETLIB=1 -DSTANDALONE_IMAGE_LIB=1 -DXP_UNIX=1
-DUNIX_EMBED=1 -DX_PLUGINS=1 -DUNIX_LDAP=1 -DUNIX_ASYNC_DNS=1 -DJS_THREADSAFE=1
-DLAYERS=1 -DNETSCAPE=1 -DNGEDITOR=1  -g +Z  -DDEBUG -UNDEBUG -DDEBUG_cltbld
-DTRACING -DOSTYPE=\"HP-UXB.10\" -DSingleSignon -DCookieManagement
-DClientWallet  -I../../../../dist/./include -I../../../../dist/include
-I../../../../../include -I/builds/tinderbox/SeaMonkey/nspr/include
-I../../../../dist/./public/jpeg -I../../../../dist/./public/png
-I../../../../dist/./public/zlib  -I/usr/include/X11
../../../../../mailnews/db/msgdb/src/nsDBFolderInfo.cpp
     Error (future) 250:
"../../../../../mailnews/db/msgdb/src/nsDBFolderInfo.cpp", line 626 # An object
cannot be deleted using a pointer of type 'void *' since the type of the object
allocated is unknown. Either delete the object using the allocated type or call
operator delete directly.
                 delete[] yarn.mYarn_Buf;        // won't need this when we have
nsCString
                          ^^^^^^^^^^^^^^
NEXT Warning:   1 future errors were detected and ignored. Add a '+p' option to
detect and fix them before they become fatal errors in a future release.
Behavior of this ill-formed program is not guaranteed to match that of a
well-formed program
cc David Bienvenu; those probably need a cast to (char*) since
mYarn_Buf is void*
No new; this comment is intended to quiet Bugzilla auto-notices.
Target Milestone: M9
Adding self to cc-list and setting target fix version to m9 (though I'd like to
get the fixes checked in today.)
David B,

Did you check in these changes?  Should this be reassigned to you?
No, I didn't check in this fix. I'm not sure why David can't check it in
himself.
Sorry.  I thought your comment above mine meant that you had the fixes to check
in.
Oh, sorry, I did check in my changes to nsDBFolderInfo (I think, I'll have to go
look), but David still has changes in Mork to check in.
Looks like I have to fix in "delete [] inBlock" in orkinHeap.cpp.

(As an aside, I would not have used delete [] notation there, so I

wonder if the addition of [] caused the problem; is delete defined

on void*?)  Anyway, it should be "delete [] (char*) inBlock".
If you can get this in today, you should, otherwise we should move this to M10
since I don't think this is a M9 stopper.
Target Milestone: M9 → M10
Moving to M10.
Bulk move mail/news M10 bugs to M11
Not a beta blocker. Triage to M14
Blocks: 11091
(target milestone is M11 or M12 - add to mail beta tracking bug)
Target Milestone: M11 → M12
M12
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
I believe this is fixed - I can't find any code that still looks like the
flagged code.
QA has no resources to verify this bug. Please verify it or advise us  how to
verify it. Thanks.
Status: RESOLVED → VERIFIED
This bug only describes warnings generated by some compilers, especially those
which are more paranoid or have been set to preferences or command line options
to care more about potential problems.  So verification can only be done at
compile time be examining for absence of warnings as described.  There are no
runtime effects.
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.