Bug 61693 - compilation fixes for malloc.c
Summary: compilation fixes for malloc.c
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Stephan Kulow
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-26 16:14 UTC by Michael Jahn
Modified: 2003-07-28 11:46 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
compilation fixes (587 bytes, patch)
2003-07-26 16:16 UTC, Michael Jahn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Jahn 2003-07-26 16:14:21 UTC
Version:           CVS HEAD (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.2 
OS:          Linux

This is just a simple compilation fix for kdelibs/kdecore/malloc/malloc.c. Without the attached patch, I get the following error in CVS Head with 

./configure --with-alsa --enable-fast-malloc=debug --with-xinerama --enable-debug=full

and gcc 3.2:

malloc.c:375:10: #if with no expression
malloc.c:2475:12: operator '!' has no right operand
malloc.c: In function `do_check_chunk':
malloc.c:2504: warning: unused variable `sz'
malloc.c:2507: warning: unused variable `min_address'
malloc.c: In function `do_check_free_chunk':
malloc.c:2554: warning: unused variable `av'
malloc.c:2557: warning: unused variable `next'
malloc.c: In function `do_check_remalloced_chunk':
malloc.c:2637: warning: unused variable `sz'
malloc.c:2632: warning: unused parameter `s'
malloc.c: In function `do_check_malloc_state':
malloc.c:2724: warning: comparison between signed and unsigned
malloc.c: In function `sYSMALLOc':
malloc.c:3163: warning: declaration of `brk' shadows a global declaration
/usr/include/unistd.h:866: warning: shadowed declaration is here
malloc.c: In function `mEMALIGn':
malloc.c:4138: warning: declaration of `brk' shadows a global declaration
/usr/include/unistd.h:866: warning: shadowed declaration is here
malloc.c:4428:10: #if with no expression
malloc.c: At top level:
malloc.c:4625: warning: no previous prototype for `mSTATs'
malloc.c:5732: warning: no previous prototype for `posix_memalign'
malloc.c:4625: warning: `mSTATs' defined but not used
make: *** [malloc.lo] Error 1
Comment 1 Michael Jahn 2003-07-26 16:16:38 UTC
Created attachment 2076 [details]
compilation fixes

Created with diff -u malloc.old malloc.c
Comment 2 Lubos Lunak 2003-07-28 11:46:37 UTC
Subject: kdelibs/kdecore/malloc

CVS commit by lunakl: 

#if DEBUG -> #ifdef DEBUG
Thanks for the patch.
CCMAIL: 61693-done@bugs.kde.org


  M +3 -3      malloc.c   1.13


--- kdelibs/kdecore/malloc/malloc.c  #1.12:1.13
@@ -373,5 +373,5 @@ extern "C" {
 */
 
-#if DEBUG
+#ifdef DEBUG
 #include <assert.h>
 #else
@@ -2473,5 +2473,5 @@ static Void_t** iALLOc();
 */
 
-#if ! DEBUG
+#ifndef DEBUG
 
 #define check_chunk(P)
@@ -4426,5 +4426,5 @@ static Void_t** iALLOc(n_elements, sizes
   }
 
-#if DEBUG
+#ifdef DEBUG
   if (marray != chunks) {
     /* final element must have exactly exhausted chunk */