Bug 65234 - 3.2.0-alpha2: kmail won't compile on Solaris
Summary: 3.2.0-alpha2: kmail won't compile on Solaris
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-30 14:14 UTC by Torsten Kasch
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
patch for kdepim/kmail/kmfolderindex.cpp (1.26 KB, patch)
2003-09-30 14:17 UTC, Torsten Kasch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Kasch 2003-09-30 14:14:51 UTC
Version:            (using KDE KDE 3.1.92)
Installed from:    Compiled From Sources
Compiler:          gcc version 2.95.3 20010315 (release) 
OS:          Solaris

Another compilation problem on Solaris:

source='kmfolderindex.cpp' object='kmfolderindex.lo' libtool=yes \
depfile='.deps/kmfolderindex.Plo' tmpdepfile='.deps/kmfolderindex.TPlo' \
depmode=gcc /bin/ksh ../admin/depcomp \
/bin/ksh ../libtool --silent --mode=compile --tag=CXX g++ -pipe -DHAVE_CONFIG_H -I. -I. -I.. -I../libkdenetwork -I../libkdepim -I../libksieve -I../mimelib -I../ktnef -I.. -I/vol/kde-cvs/include -I/vol/qt-3.2.1/include   -I/vol/local/include -I/vol/graphics/include -I/vol/palmpilot/include  -DQT_THREAD_SUPPORT -I/vol/palmpilot/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -O2 -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -c -o kmfolderindex.lo `test -f 'kmfolderindex.cpp' || echo './'`kmfolderindex.cpp
kmfolderindex.cpp: In method `bool KMFolderIndex::updateIndexStreamPtr(bool = FALSE)':
kmfolderindex.cpp:373: passing `uchar *' as argument 1 of `munmap(char *, unsigned int)' changes signedness
kmfolderindex.cpp:383: passing `uchar *' as argument 1 of `munmap(char *, unsigned int)' changes signedness
kmfolderindex.cpp:389: passing `uchar *' as argument 1 of `munmap(char *, unsigned int)' changes signedness
make[1]: *** [kmfolderindex.lo] Error 1
make[1]: Leaving directory `/vol/src/kde/cvs/kdepim/kmail'
make: *** [all-recursive] Error 1
Comment 1 Torsten Kasch 2003-09-30 14:17:36 UTC
Created attachment 2649 [details]
patch for kdepim/kmail/kmfolderindex.cpp

Although munmap(2) tells me that munmap() should take a "void *" as its first
argument, it seems that I need the attached patch to make KMail compile...
Comment 2 Marc Mutz 2003-10-02 19:36:16 UTC
Subject: kdepim/kmail

CVS commit by mutz: 

Fix Solaris compile errors reported and patched by Torsten Kasch <tk (at ) Genetik (dot) uni-bielefeld (dot) de>
CCMAIL: 65234-done@bugs.kde.org, 65232-done@bugs.kde.org


  M +3 -3      kmfolderindex.cpp   1.11
  M +1 -1      kmmsgbase.cpp   1.160


--- kdepim/kmail/kmfolderindex.cpp  #1.10:1.11
@@ -371,5 +371,5 @@ bool KMFolderIndex::updateIndexStreamPtr
     if(just_close) {
         if(mIndexStreamPtr)
-            munmap(mIndexStreamPtr, mIndexStreamPtrLength);
+            munmap((char *)mIndexStreamPtr, mIndexStreamPtrLength);
         mIndexStreamPtr = 0;
         mIndexStreamPtrLength = 0;
@@ -381,5 +381,5 @@ bool KMFolderIndex::updateIndexStreamPtr
     if(fstat(fileno(mIndexStream), &stat_buf) == -1) {
         if(mIndexStreamPtr)
-            munmap(mIndexStreamPtr, mIndexStreamPtrLength);
+            munmap((char *)mIndexStreamPtr, mIndexStreamPtrLength);
         mIndexStreamPtr = 0;
         mIndexStreamPtrLength = 0;
@@ -387,5 +387,5 @@ bool KMFolderIndex::updateIndexStreamPtr
     }
     if(mIndexStreamPtr)
-        munmap(mIndexStreamPtr, mIndexStreamPtrLength);
+        munmap((char *)mIndexStreamPtr, mIndexStreamPtrLength);
     mIndexStreamPtrLength = stat_buf.st_size;
     mIndexStreamPtr = (uchar *)mmap(0, mIndexStreamPtrLength, PROT_READ, MAP_SHARED,

--- kdepim/kmail/kmmsgbase.cpp  #1.159:1.160
@@ -1145,5 +1145,5 @@ off_t KMMsgBase::getLongPart(MsgPartType
 #ifndef WORDS_BIGENDIAN
 // We need to use swab to swap bytes to network byte order
-#define memcpy_networkorder(to, from, len)  swab(from, to, len)
+#define memcpy_networkorder(to, from, len)  swab((char *)(from), (char *)(to), len)
 #else
 // We're already in network byte order