Bug 70610 - compile error on Solaris 2.6 - `alloca' undeclared
Summary: compile error on Solaris 2.6 - `alloca' undeclared
Status: RESOLVED FIXED
Alias: None
Product: arts
Classification: Miscellaneous
Component: xine_artsplugin (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Multimedia Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-16 16:29 UTC by Steve Evans
Modified: 2004-07-16 12:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Evans 2003-12-16 16:29:53 UTC
Version:            (using KDE KDE 3.1.94)
Installed from:    Compiled From Sources
Compiler:          gcc 3.2.3 
OS:          Solaris

When compiling on Solaris 2.6 I get this error:

if /bin/ksh ../../../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I/opt/kde/include/arts -I/opt/kde/include -I/opt/qt/include   -I/gorbag/exta/cad/externals/SOLARIS/include -I/gorbag/exta/cad/externals/SOLARIS/include  -DQT_THREAD_SUPPORT -I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include  -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include -O2 -fomit-frame-pointer -DNeedVarargsPrototypes=1 -DNeedFunctionPrototypes=1 -pipe -fno-exceptions -mcpu=ultrasparc -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -MT videoscaler.lo -MD -MP -MF ".deps/videoscaler.Tpo" \
  -c -o videoscaler.lo `test -f 'videoscaler.cpp' || echo './'`videoscaler.cpp; \
then mv -f ".deps/videoscaler.Tpo" ".deps/videoscaler.Plo"; \
else rm -f ".deps/videoscaler.Tpo"; exit 1; \
fi
videoscaler.cpp:36: warning: aggregate has a partly bracketed initializer
videoscaler.cpp: In function `void scaleYuvToRgb32(int, int, unsigned char**, 
   unsigned int*, int, int, unsigned int*, unsigned int)':
videoscaler.cpp:150: `alloca' undeclared (first use this function)
videoscaler.cpp:150: (Each undeclared identifier is reported only once for each 
   function it appears in.)
gmake[4]: *** [videoscaler.lo] Error 1
gmake[4]: Leaving directory `/tmp/kdemultimedia-3.1.94/xine_artsplugin/tools/thumbnail'

It appears that videoscaler.cpp makes use of alloca, but the header file required for that function on Solaris (alloca.h) is only included if HAVE_ALLOCA_H is defined, and the configure process does *not* define it.
Comment 1 David Rutitsky 2004-01-11 11:09:14 UTC
Proper recognition of alloca.h present in kdelibs configure.
Comment 2 Aaron Williams 2004-02-04 23:09:29 UTC
I am having this same problem in 3.2.0 with kdemultimedia.  configure does not check if alloca.h is required and videoscaler.cpp needs to include config.h before checking HAVE_ALLOCA_H

To work around this temporarily I added

#define HAVE_ALLOCA_H to config.h and changed videoscaler.cpp to include config,h before #ifdef HAVE_ALLOCA_H

Comment 3 Steve Evans 2004-05-11 12:04:27 UTC
This still happens in 3.2.2
Comment 4 Allan Sandfeld 2004-07-16 12:57:21 UTC
CVS commit by carewolf: 

Check for alloca.h
CCMAIL:70610-done@bugs.kde.org


  M +1 -1      configure.in.in   1.55
  M +2 -0      xine_artsplugin/tools/thumbnail/videoscaler.cpp   1.4


--- kdemultimedia/configure.in.in  #1.54:1.55
@@ -4,5 +4,5 @@
 AC_HEADER_DIRENT
 AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h features.h linux/awe_voice.h awe_voice.h /usr/src/sys/i386/isa/sound/awe_voice.h /usr/src/sys/gnu/i386/isa/sound/awe_voice.h linux/ucdrom.h sys/stdtypes.h sys/filio.h sys/audioio.h Alib.h sys/sem.h string.h getopt.h machine/endian.h sys/awe_voice.h)
+AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h features.h alloca.h linux/awe_voice.h awe_voice.h /usr/src/sys/i386/isa/sound/awe_voice.h /usr/src/sys/gnu/i386/isa/sound/awe_voice.h linux/ucdrom.h sys/stdtypes.h sys/filio.h sys/audioio.h Alib.h sys/sem.h string.h getopt.h machine/endian.h sys/awe_voice.h)
 
 dnl First, setup HAVE_LINUX_CDROM_H.

--- kdemultimedia/xine_artsplugin/tools/thumbnail/videoscaler.cpp  #1.3:1.4
@@ -18,4 +18,6 @@
 #include <pthread.h>
 
+#include <config.h>
+
 #ifdef HAVE_ALLOCA_H
 #include <alloca.h>