Version: unspecified (using Devel) OS: Solaris building kdebindings 4.4.92 fails with the below message. This is because variable size arrays are not part of the C++ standard and the Sun Studio compiler does not support them. AFAIK MSVC does not support them either. I do not have a patch ATM, but generally people recommend using vector instead. test@continuousbuild:~/packages/BUILD/kdebindings-4.4.92/build-kdebindings-4.4.92/perl/qtcore/src$ cd /export/home/test/packages/BUILD/kdebindings-4.4.92/build-kdebindings-4.4.92/perl/qtcore/src && /opt/sunstudio12.1/bin/CC -library=no%Cstd -library=Crun -Dperlqtcore4_EXPORTS -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS -DQT3_SUPPORT -DDEBUG -DDEBUG -D__EXTENSIONS__ -DSOLARIS -D_REENTRANT -DNDEBUG -D__EXTENSIONS__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS -DSOLARIS10 -DNO_DEBUG -D_UNICODE -DUNICODE -D_RWSTD_REENTRANT -D_XOPEN_SOURCE=500 -D_XPG5 -I/usr/include/stdcxx4/ansi -I/usr/include/stdcxx4 -I/opt/kde4/include -I/opt/kde4/include/boost-1_43 -DHAS_BOOL -I/usr/include/stdcxx4/ansi -I/usr/include/stdcxx4 -library=no%Cstd -library=Crun -features=anachronisms,except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic -instances=global -template=geninlinefuncs -s -xdebugformat=dwarf -xlang=c99 -xalias_level=compatible -xustr=ascii_utf16_ushort -Qoption ccfe -features=gcc -Qoption ccfe -features=zla -Qoption ccfe ++boolflag:sunwcch=false -mt -xF=%none -xbuiltin=%all -xinline=%auto -xprefetch=auto -xprefetch_auto_type=indirect_array_access -xprefetch_level=3 -xalias_level=compatible -KPIC -DPIC -xipo=0 -xO3 -xregs=no%frameptr -xjobs=2 -xrestrict=%all -xthreadvar=%all -z combreloc -z redlocsym -z nodefaultlib -z ignore -z now -z rescan -z absexec -xldscope=symbolic -xlibmil -s -xtarget=pentium4 -m32 -xarch=sse2 -xchip=pentium4 -xcache=8/64/4:256/128/8 -lc -lm -ldl -lpthread -lposix4 -lrt -mt -L/opt/kde4/lib -R/opt/kde4/lib -L/usr/lib -R/usr/lib -Y P,/opt/kde4/lib -i -L/opt/kde4/lib -R/opt/kde4/lib -L/usr/lib -R/usr/lib -Bdynamic -lstdcxx4 -lCrun -lc -lm -DQT_NO_DEBUG -KPIC -I/export/home/test/packages/BUILD/kdebindings-4.4.92/build-kdebindings-4.4.92/perl/qtcore/src -I/export/home/test/packages/BUILD/kdebindings-4.4.92/perl/qtcore/src -I/export/home/test/packages/BUILD/kdebindings-4.4.92 -I/export/home/test/packages/BUILD/kdebindings-4.4.92/build-kdebindings-4.4.92 -I/export/home/test/packages/BUILD/kdebindings-4.4.92/smoke -I/opt/kde4/include -I/opt/kde4/include/KDE -I/opt/kde4/include/QtXmlPatterns -I/opt/kde4/include/QtXml -I/opt/kde4/include/QtWebKit -I/opt/kde4/include/QtUiTools -I/opt/kde4/include/QtTest -I/opt/kde4/include/QtSvg -I/opt/kde4/include/QtSql -I/opt/kde4/include/QtScriptTools -I/opt/kde4/include/QtScript -I/opt/kde4/include/QtOpenGL -I/opt/kde4/include/QtNetwork -I/opt/kde4/include/QtMultimedia -I/opt/kde4/include/QtHelp -I/opt/kde4/include/QtDesigner -I/opt/kde4/include/QtDBus -I/opt/kde4/include/QtAssistant -I/opt/kde4/include/Qt3Support -I/opt/kde4/include/QtGui -I/opt/kde4/include/QtCore -I/opt/kde4/include/Qt -I/opt/kde4/share/mkspecs/default -I/usr/X11/include -I/usr/perl5/5.8.4/lib/i86pc-solaris-64int/CORE -D_LARGEFILE64_SOURCE -o CMakeFiles/perlqtcore4.dir/util.o -c /export/home/test/packages/BUILD/kdebindings-4.4.92/perl/qtcore/src/util.cpp "/export/home/test/packages/BUILD/kdebindings-4.4.92/perl/qtcore/src/smokeperl.h", line 52: Warning: Identifier expected instead of "}". "/export/home/test/packages/BUILD/kdebindings-4.4.92/perl/qtcore/src/util.cpp", line 429: Error: An integer constant expression is required within the array subscript operator. Reproducible: Always
Created attachment 49371 [details] Create variable size array on the heap I looked through the rest of the source, and this is the only location I see that doesn't use new[] to make a variable sized array.
Comment on attachment 49371 [details] Create variable size array on the heap --- kdebindings-4.4.92/perl/qtcore/src/util.cpp 2010-06-24 09:31:32.000000000 -0700 +++ kdebindings/perl/qtcore/src/util.cpp 2010-07-21 14:03:12.383019515 -0700 @@ -426,10 +426,9 @@ } // Get the ISA array, nisa is a temp string to build package::ISA - char nisa[strlen(package)+6]; + char *nisa = new char[strlen(package)+6]; sprintf( nisa, "%s::ISA", package ); AV* isa = get_av( nisa, true ); + delete[] nisa; // Loop over the ISA array for( int i = 0; i <= av_len( isa ); i++ ) {
Comment on attachment 49371 [details] Create variable size array on the heap This patch is reversed.
Created attachment 49373 [details] Create variable size array on the heap
confirming the patch helped
This patch was applied in revision 1155137.