Bug#35602: xmalloc.c error is undefined
keith at kaboing.net
keith at kaboing.net
Fri Nov 30 20:04:01 UTC 2001
Package: kdevelop
Version: KDE 2.2.2
Severity: normal
Installed from: Compiled From Sources
Compiler: gcc 2.95.3
OS: FreeBSD
OS/Compiler notes: FreeBSD 4.4
while compiling kdesdk-2.2.2, kbabel does not compile due to error being undefined in common/libgettext.a from xmalloc.c
/bin/sh ../../libtool --mode=link --tag=CXX g++ -O2 -fno-exceptions -fno-check-new -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT
-DQT_NO_ASCII_CAST -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST -o libkbabelcommon.la.closure libkbabelcommon_la_closure.lo -Llibgettext -L/usr/X11R6/lib -L/usr/local/qt-2.3.1//lib -L/usr/local/kde/lib -L/usr/local/lib -module
-version-info 1:0:0 -no-undefined catalog.lo catalogitem.lo editcmd.lo msgfmt.lo catalogsettings.lo tagextractor.lo diff.lo libkbabelcommon_la_meta_unload.lo -lkio -lkdecore -lgettext
libtool: link: warning: `-version-info' is ignored for programs
g++ -O2 -fno-exceptions -fno-check-new -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST -o libkbabelcommon.la.closure .libs/libkbabelcommon_la_closure.o .libs/catalog.o .libs/catalogitem.o .libs/editcmd.o .libs/msgfmt.o .libs/catalogsettings.o .libs/tagextractor.o .libs/diff.o .libs/libkbabelcommon_la_meta_unload.o -L/home/keith/src/kde2.2.2/kdesdk-2.2.2/kbabel/common/libgettext -L/usr/X11R6/lib -L/usr/local/qt-2.3.1//lib -L/usr/local/kde/lib -L/usr/local/lib /usr/local/kde/lib/libkio.so -L/usr/libexec/elf -L/usr/libexec -L/usr/lib
/usr/local/kde/lib/libkdesu.so -lutil /usr/local/kde/lib/libkssl.so /usr/local/kde/lib/libkdeui.so /usr/local/kde/lib/libkdecore.so /usr/local/kde/lib/libDCOP.so -lqt -lpng -lz -ljpeg -lXext -lX11 -lSM -lICE -lstdc++ -lm /home/keith/src/kde2.2.2/kdesdk-2.2.2/kbabel/common/libgettext/.libs/libgettext.a -Wl,--rpath -Wl,/usr/local/kde/lib -Wl,--rpath -Wl,/usr/local/kde/lib
/home/keith/src/kde2.2.2/kdesdk-2.2.2/kbabel/common/libgettext/.libs/libgettext.a(xmalloc.o): In function `fixup_null_alloc':
xmalloc.o(.text+0x44): undefined reference to `error'
gmake[1]: *** [libkbabelcommon.la.closure] Error 1
gmake[1]: Leaving directory `/home/keith/src/kde2.2.2/kdesdk-2.2.2/kbabel/common'
gmake: *** [all-recursive] Error 1
the following patch will fix the problem. Note: only tested on FreeBSD 4.4
*** xmalloc.c.orig Mon Apr 9 06:30:55 2001
--- xmalloc.c Fri Nov 30 10:54:45 2001
***************
*** 26,31 ****
--- 26,32 ----
#endif
#include <sys/types.h>
+ #include <err.h>
#if STDC_HEADERS
# include <stdlib.h>
***************
*** 61,67 ****
The caller may set it to some other value. */
int xmalloc_exit_failure = EXIT_FAILURE;
- void error (int, int, const char *, ...);
static VOID *
fixup_null_alloc (n)
--- 62,67 ----
***************
*** 73,79 ****
if (n == 0)
p = malloc ((size_t) 1);
if (p == 0)
! error (xmalloc_exit_failure, 0, _("Memory exhausted"));
return p;
}
--- 73,79 ----
if (n == 0)
p = malloc ((size_t) 1);
if (p == 0)
! err (xmalloc_exit_failure, "Memory exhausted");
return p;
}
---------
--Keith
(Submitted via bugs.kde.org)
More information about the KDevelop-devel
mailing list