From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2320 invoked by alias); 28 Feb 2003 00:26:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 2306 invoked by uid 71); 28 Feb 2003 00:26:00 -0000 Date: Fri, 28 Feb 2003 00:26:00 -0000 Message-ID: <20030228002600.2305.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Sandor Kovacs Subject: Re: c++/9872: temporary destructor not called? Reply-To: Sandor Kovacs X-SW-Source: 2003-02/txt/msg01460.txt.bz2 List-Id: The following reply was made to PR c++/9872; it has been noted by GNATS. From: Sandor Kovacs To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, sakovacs@freemail.hu, gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/9872: temporary destructor not called? Date: Fri, 28 Feb 2003 00:17:25 +0000 --Boundary-00=_VqqX+2CdDYIEEST Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline (Hopefully now complete) bug report for " temporary destructor not called?" (see http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9872) Symptoms: simple test program eats up memory if not compiled with -fno-elide-constructors. (simple program attached) 1) ouput of gcc -v: Reading specs from /usr/lib/gcc-lib/i486-suse-linux/3.2/specs Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linuxThread model: posixgcc version 3.2- the system type: suse 8.1; uname -a:Linux dragon 2.4.20-ck2 #6 Tue Feb 4 08:44:23 JST 2003 i686 unknown - the options given when GCC was configured/built: see above (using the gcc3.2 shipped with suse8.1) - the complete command line that triggers the bug: gcc -I/usr/lib/qt3/include -c bug.cpp gcc -L/usr/lib/qt3/lib -lqt-mt bug.o -o bug ./bug 2) the compiler output (error messages, warnings, etc.): no compiler output ie. no error/warning messages 3) the preprocessed file (*.i*) that triggers the bug, generated by adding -save-temps... : gcc output: (see attachment for .ii file) > gcc -v -save-temps -I/usr/lib/qt3/include -c bug.cpp Reading specs from /usr/lib/gcc-lib/i486-suse-linux/3.2/specs Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linuxThread model: posixgcc version 3.2 /usr/lib/gcc-lib/i486-suse-linux/3.2/cpp0 -lang-c++ -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -v -I/usr/lib/qt3/include -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i486__ bug.cpp bug.iiGNU CPP version 3.2 (cpplib) (i386 Linux/ELF)#include "..." search starts here:#include <...> search starts here: /usr/lib/qt3/include /usr/include/g++ /usr/include/g++/i486-suse-linux /usr/include/g++/backward /usr/local/include /usr/lib/gcc-lib/i486-suse-linux/3.2/include /usr/i486-suse-linux/include /usr/includeEnd of search list. /usr/lib/gcc-lib/i486-suse-linux/3.2/cc1plus -fpreprocessed bug.ii -quiet -dumpbase bug.cpp -version -o bug.sGNU CPP version 3.2 (cpplib) (i386 Linux/ELF)GNU C++ version 3.2 (i486-suse-linux) compiled by GNU C version 3.2. /usr/lib/gcc-lib/i486-suse-linux/3.2/../../../../i486-suse-linux/bin/as -V -Qy -o bug.o bug.sGNU assembler version 2.12.90.0.15 (i486-suse-linux) using BFD version 2.12.90.0.15 20020717 (SuSE) 4)... you may want to post parts of it to point out assembly code you consider to be wrong: I attach the asm file as well, but have no idea which part of the code is wrong If I've missed something or you need further info please let me know; Sandor > Synopsis: temporary destructor not called? > > State-Changed-From-To: open->feedback > State-Changed-By: bangerth > State-Changed-When: Thu Feb 27 15:32:14 2003 > State-Changed-Why: > We need the _preprocessed_ source to reproduce the problem. > Please take a look at > http://gcc.gnu.org/bugs.html > > Thanks > Wolfgang > > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc& >pr=9872 --Boundary-00=_VqqX+2CdDYIEEST Content-Type: text/x-c++src; charset="iso-8859-1"; name="bug.cpp" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bug.cpp" /** * Compile: * gcc -I/usr/lib/qt3/include -c bug.cpp * gcc -L/usr/lib/qt3/lib -lqt-mt bug.o -o bug */ #include void tester(QString str) { } int main(int argc, char** argv) { QString str("bug"); while (true) tester("ops: " + str); } --Boundary-00=_VqqX+2CdDYIEEST Content-Type: text/x-csrc; charset="iso-8859-1"; name="bug.ii" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bug.ii" # 1 "bug.cpp" # 1 "" # 1 "" # 1 "bug.cpp" # 1 "/usr/lib/qt3/include/qstring.h" 1 # 42 "/usr/lib/qt3/include/qstring.h" # 1 "/usr/lib/qt3/include/qcstring.h" 1 # 43 "/usr/lib/qt3/include/qcstring.h" # 1 "/usr/lib/qt3/include/qmemarray.h" 1 # 42 "/usr/lib/qt3/include/qmemarray.h" # 1 "/usr/lib/qt3/include/qgarray.h" 1 # 42 "/usr/lib/qt3/include/qgarray.h" # 1 "/usr/lib/qt3/include/qshared.h" 1 # 42 "/usr/lib/qt3/include/qshared.h" # 1 "/usr/lib/qt3/include/qglobal.h" 1 # 573 "/usr/lib/qt3/include/qglobal.h" typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned uint; typedef unsigned long ulong; typedef char *pchar; typedef uchar *puchar; typedef const char *pcchar; const bool FALSE = 0; const bool TRUE = !0; # 630 "/usr/lib/qt3/include/qglobal.h" inline int qRound( double d ) { return d >= 0.0 ? int(d + 0.5) : int( d - ((int)d-1) + 0.5 ) + ((int)d-1); } # 642 "/usr/lib/qt3/include/qglobal.h" typedef signed char INT8; typedef unsigned char UINT8; typedef short INT16; typedef unsigned short UINT16; typedef int INT32; typedef unsigned int UINT32; typedef signed char Q_INT8; typedef unsigned char Q_UINT8; typedef short Q_INT16; typedef unsigned short Q_UINT16; typedef int Q_INT32; typedef unsigned int Q_UINT32; typedef long Q_LONG; typedef unsigned long Q_ULONG; # 678 "/usr/lib/qt3/include/qglobal.h" typedef Q_ULONG QtOffset; class QDataStream; # 710 "/usr/lib/qt3/include/qglobal.h" # 1 "/usr/lib/qt3/include/qconfig.h" 1 # 711 "/usr/lib/qt3/include/qglobal.h" 2 # 720 "/usr/lib/qt3/include/qglobal.h" # 1 "/usr/lib/qt3/include/qmodules.h" 1 # 721 "/usr/lib/qt3/include/qglobal.h" 2 # 773 "/usr/lib/qt3/include/qglobal.h" # 1 "/usr/lib/qt3/include/qfeatures.h" 1 # 774 "/usr/lib/qt3/include/qglobal.h" 2 # 840 "/usr/lib/qt3/include/qglobal.h" const char *qVersion(); bool qSysInfo( int *wordSize, bool *bigEndian ); # 901 "/usr/lib/qt3/include/qglobal.h" void qDebug( const char *, ... ) __attribute__ ((format (printf, 1, 2))) ; void qWarning( const char *, ... ) __attribute__ ((format (printf, 1, 2))) ; void qFatal( const char *, ... ) __attribute__ ((format (printf, 1, 2))) ; void qSystemWarning( const char *, int code = -1 ); void debug( const char *, ... ) __attribute__ ((format (printf, 1, 2))) ; void warning( const char *, ... ) __attribute__ ((format (printf, 1, 2))) ; void fatal( const char *, ... ) __attribute__ ((format (printf, 1, 2))) ; # 965 "/usr/lib/qt3/include/qglobal.h" bool qt_check_pointer( bool c, const char *, int ); # 979 "/usr/lib/qt3/include/qglobal.h" enum QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg }; typedef void (*QtMsgHandler)(QtMsgType, const char *); QtMsgHandler qInstallMsgHandler( QtMsgHandler ); typedef QtMsgHandler msg_handler; void qSuppressObsoleteWarnings( bool = TRUE ); void qObsolete( const char *obj, const char *oldfunc, const char *newfunc ); void qObsolete( const char *obj, const char *oldfunc ); void qObsolete( const char *message ); const char *qInstallPath(); const char *qInstallPathDocs(); const char *qInstallPathHeaders(); const char *qInstallPathLibs(); const char *qInstallPathBins(); const char *qInstallPathPlugins(); const char *qInstallPathData(); # 43 "/usr/lib/qt3/include/qshared.h" 2 struct QShared { QShared() : count( 1 ) { } void ref() { count++; } bool deref() { return !--count; } uint count; }; # 43 "/usr/lib/qt3/include/qgarray.h" 2 class QGArray { friend class QBuffer; public: struct array_data : public QShared { array_data():data(0),len(0) {} char *data; uint len; }; QGArray(); enum Optimization { MemOptim, SpeedOptim }; protected: QGArray( int, int ); QGArray( int size ); QGArray( const QGArray &a ); virtual ~QGArray(); QGArray &operator=( const QGArray &a ) { return assign( a ); } virtual void detach() { duplicate(*this); } char *data() const { return shd->data; } uint nrefs() const { return shd->count; } uint size() const { return shd->len; } bool isEqual( const QGArray &a ) const; bool resize( uint newsize, Optimization optim ); bool resize( uint newsize ); bool fill( const char *d, int len, uint sz ); QGArray &assign( const QGArray &a ); QGArray &assign( const char *d, uint len ); QGArray &duplicate( const QGArray &a ); QGArray &duplicate( const char *d, uint len ); void store( const char *d, uint len ); array_data *sharedBlock() const { return shd; } void setSharedBlock( array_data *p ) { shd=(array_data*)p; } QGArray &setRawData( const char *d, uint len ); void resetRawData( const char *d, uint len ); int find( const char *d, uint index, uint sz ) const; int contains( const char *d, uint sz ) const; void sort( uint sz ); int bsearch( const char *d, uint sz ) const; char *at( uint index ) const; bool setExpand( uint index, const char *d, uint sz ); protected: virtual array_data *newData(); virtual void deleteData( array_data *p ); private: static void msg_index( uint ); array_data *shd; }; inline char *QGArray::at( uint index ) const { if ( index >= size() ) { msg_index( index ); index = 0; } return &shd->data[index]; } # 43 "/usr/lib/qt3/include/qmemarray.h" 2 template class QMemArray : public QGArray { public: typedef type* Iterator; typedef const type* ConstIterator; typedef type ValueType; protected: QMemArray( int, int ) : QGArray( 0, 0 ) {} public: QMemArray() {} QMemArray( int size ) : QGArray(size*sizeof(type)) {} QMemArray( const QMemArray &a ) : QGArray(a) {} ~QMemArray() {} QMemArray &operator=(const QMemArray &a) { return (QMemArray&)QGArray::assign(a); } type *data() const { return (type *)QGArray::data(); } uint nrefs() const { return QGArray::nrefs(); } uint size() const { return QGArray::size()/sizeof(type); } uint count() const { return size(); } bool isEmpty() const { return QGArray::size() == 0; } bool isNull() const { return QGArray::data() == 0; } bool resize( uint size ) { return QGArray::resize(size*sizeof(type)); } bool resize( uint size, Optimization optim ) { return QGArray::resize(size*sizeof(type), optim); } bool truncate( uint pos ) { return QGArray::resize(pos*sizeof(type)); } bool fill( const type &d, int size = -1 ) { return QGArray::fill((char*)&d,size,sizeof(type) ); } void detach() { QGArray::detach(); } QMemArray copy() const { QMemArray tmp; return tmp.duplicate(*this); } QMemArray& assign( const QMemArray& a ) { return (QMemArray&)QGArray::assign(a); } QMemArray& assign( const type *a, uint n ) { return (QMemArray&)QGArray::assign((char*)a,n*sizeof(type)); } QMemArray& duplicate( const QMemArray& a ) { return (QMemArray&)QGArray::duplicate(a); } QMemArray& duplicate( const type *a, uint n ) { return (QMemArray&)QGArray::duplicate((char*)a,n*sizeof(type)); } QMemArray& setRawData( const type *a, uint n ) { return (QMemArray&)QGArray::setRawData((char*)a, n*sizeof(type)); } void resetRawData( const type *a, uint n ) { QGArray::resetRawData((char*)a,n*sizeof(type)); } int find( const type &d, uint i=0 ) const { return QGArray::find((char*)&d,i,sizeof(type)); } int contains( const type &d ) const { return QGArray::contains((char*)&d,sizeof(type)); } void sort() { QGArray::sort(sizeof(type)); } int bsearch( const type &d ) const { return QGArray::bsearch((const char*)&d,sizeof(type)); } type& operator[]( int i ) const { return (type &)(*(type *)QGArray::at(i*sizeof(type))); } type& at( uint i ) const { return (type &)(*(type *)QGArray::at(i*sizeof(type))); } operator const type*() const { return (const type *)QGArray::data(); } bool operator==( const QMemArray &a ) const { return isEqual(a); } bool operator!=( const QMemArray &a ) const { return !isEqual(a); } Iterator begin() { return data(); } Iterator end() { return data() + size(); } ConstIterator begin() const { return data(); } ConstIterator end() const { return data() + size(); } }; # 44 "/usr/lib/qt3/include/qcstring.h" 2 # 1 "/usr/include/string.h" 1 3 # 26 "/usr/include/string.h" 3 # 1 "/usr/include/features.h" 1 3 # 283 "/usr/include/features.h" 3 # 1 "/usr/include/sys/cdefs.h" 1 3 # 284 "/usr/include/features.h" 2 3 # 312 "/usr/include/features.h" 3 # 1 "/usr/include/gnu/stubs.h" 1 3 # 313 "/usr/include/features.h" 2 3 # 27 "/usr/include/string.h" 2 3 extern "C" { # 1 "/usr/lib/gcc-lib/i486-suse-linux/3.2/include/stddef.h" 1 3 # 201 "/usr/lib/gcc-lib/i486-suse-linux/3.2/include/stddef.h" 3 typedef unsigned int size_t; # 34 "/usr/include/string.h" 2 3 extern void *memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) throw (); extern void *memmove (void *__dest, __const void *__src, size_t __n) throw (); extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) throw (); extern void *memset (void *__s, int __c, size_t __n) throw (); extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) throw () __attribute__ ((__pure__)); extern void *memchr (__const void *__s, int __c, size_t __n) throw () __attribute__ ((__pure__)); extern void *rawmemchr (__const void *__s, int __c) throw () __attribute__ ((__pure__)); extern void *memrchr (__const void *__s, int __c, size_t __n) throw () __attribute__ ((__pure__)); extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) throw (); extern char *strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) throw (); extern char *strcat (char *__restrict __dest, __const char *__restrict __src) throw (); extern char *strncat (char *__restrict __dest, __const char *__restrict __src, size_t __n) throw (); extern int strcmp (__const char *__s1, __const char *__s2) throw () __attribute__ ((__pure__)); extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) throw () __attribute__ ((__pure__)); extern int strcoll (__const char *__s1, __const char *__s2) throw () __attribute__ ((__pure__)); extern size_t strxfrm (char *__restrict __dest, __const char *__restrict __src, size_t __n) throw (); # 1 "/usr/include/xlocale.h" 1 3 # 28 "/usr/include/xlocale.h" 3 typedef struct __locale_struct { struct locale_data *__locales[13]; const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; } *__locale_t; # 109 "/usr/include/string.h" 2 3 extern int __strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) throw () __attribute__ ((__pure__)); extern size_t __strxfrm_l (char *__dest, __const char *__src, size_t __n, __locale_t __l) throw (); extern char *strdup (__const char *__s) throw () __attribute__ ((__malloc__)); extern char *strndup (__const char *__string, size_t __n) throw () __attribute__ ((__malloc__)); # 155 "/usr/include/string.h" 3 extern char *strchr (__const char *__s, int __c) throw () __attribute__ ((__pure__)); extern char *strrchr (__const char *__s, int __c) throw () __attribute__ ((__pure__)); extern char *strchrnul (__const char *__s, int __c) throw () __attribute__ ((__pure__)); extern size_t strcspn (__const char *__s, __const char *__reject) throw () __attribute__ ((__pure__)); extern size_t strspn (__const char *__s, __const char *__accept) throw () __attribute__ ((__pure__)); extern char *strpbrk (__const char *__s, __const char *__accept) throw () __attribute__ ((__pure__)); extern char *strstr (__const char *__haystack, __const char *__needle) throw () __attribute__ ((__pure__)); extern char *strcasestr (__const char *__haystack, __const char *__needle) throw () __attribute__ ((__pure__)); extern char *strtok (char *__restrict __s, __const char *__restrict __delim) throw (); extern char *__strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) throw (); extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) throw (); extern void *memmem (__const void *__haystack, size_t __haystacklen, __const void *__needle, size_t __needlelen) throw () __attribute__ ((__pure__)); extern void *__mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) throw (); extern void *mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) throw (); extern size_t strlen (__const char *__s) throw () __attribute__ ((__pure__)); extern size_t strnlen (__const char *__string, size_t __maxlen) throw () __attribute__ ((__pure__)); extern char *strerror (int __errnum) throw (); extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) throw (); extern void __bzero (void *__s, size_t __n) throw (); extern void bcopy (__const void *__src, void *__dest, size_t __n) throw (); extern void bzero (void *__s, size_t __n) throw (); extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) throw () __attribute__ ((__pure__)); extern char *index (__const char *__s, int __c) throw () __attribute__ ((__pure__)); extern char *rindex (__const char *__s, int __c) throw () __attribute__ ((__pure__)); extern int ffs (int __i) throw () __attribute__ ((__const__)); extern int ffsl (long int __l) throw () __attribute__ ((__const__)); __extension__ extern int ffsll (long long int __ll) throw () __attribute__ ((__const__)); extern int strcasecmp (__const char *__s1, __const char *__s2) throw () __attribute__ ((__pure__)); extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) throw () __attribute__ ((__pure__)); extern int __strcasecmp_l (__const char *__s1, __const char *__s2, __locale_t __loc) throw () __attribute__ ((__pure__)); extern int __strncasecmp_l (__const char *__s1, __const char *__s2, size_t __n, __locale_t __loc) throw () __attribute__ ((__pure__)); extern char *strsep (char **__restrict __stringp, __const char *__restrict __delim) throw (); extern int strverscmp (__const char *__s1, __const char *__s2) throw () __attribute__ ((__pure__)); extern char *strsignal (int __sig) throw (); extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src) throw (); extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src) throw (); extern char *__stpncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) throw (); extern char *stpncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) throw (); extern char *strfry (char *__string) throw (); extern void *memfrob (void *__s, size_t __n) throw (); extern char *basename (__const char *__filename) throw (); # 364 "/usr/include/string.h" 3 } # 47 "/usr/lib/qt3/include/qcstring.h" 2 void *qmemmove( void *dst, const void *src, uint len ); char *qstrdup( const char * ); inline uint qstrlen( const char *str ) { return str ? (uint)strlen(str) : 0; } inline char *qstrcpy( char *dst, const char *src ) { return src ? strcpy(dst, src) : 0; } char *qstrncpy( char *dst, const char *src, uint len ); inline int qstrcmp( const char *str1, const char *str2 ) { return ( str1 && str2 ) ? strcmp( str1, str2 ) : ( str1 ? 1 : ( str2 ? -1 : 0 ) ); } inline int qstrncmp( const char *str1, const char *str2, uint len ) { return ( str1 && str2 ) ? strncmp( str1, str2, len ) : ( str1 ? 1 : ( str2 ? -1 : 0 ) ); } int qstricmp( const char *, const char * ); int qstrnicmp( const char *, const char *, uint len ); inline uint cstrlen( const char *str ) { return (uint)strlen(str); } inline char *cstrcpy( char *dst, const char *src ) { return strcpy(dst,src); } inline int cstrcmp( const char *str1, const char *str2 ) { return strcmp(str1,str2); } inline int cstrncmp( const char *str1, const char *str2, uint len ) { return strncmp(str1,str2,len); } Q_UINT16 qChecksum( const char *s, uint len ); # 120 "/usr/lib/qt3/include/qcstring.h" typedef QMemArray QByteArray; QByteArray qCompress( const uchar* data, int nbytes ); QByteArray qUncompress( const uchar* data, int nbytes ); inline QByteArray qCompress( const QByteArray& data) { return qCompress( (const uchar*)data.data(), data.size() ); } inline QByteArray qUncompress( const QByteArray& data ) { return qUncompress( (const uchar*)data.data(), data.size() ); } QDataStream &operator<<( QDataStream &, const QByteArray & ); QDataStream &operator>>( QDataStream &, QByteArray & ); class QRegExp; class QCString : public QByteArray { public: QCString() {} QCString( int size ); QCString( const QCString &s ) : QByteArray( s ) {} QCString( const char *str ); QCString( const char *str, uint maxlen ); ~QCString(); QCString &operator=( const QCString &s ); QCString &operator=( const char *str ); bool isNull() const; bool isEmpty() const; uint length() const; bool resize( uint newlen ); bool truncate( uint pos ); bool fill( char c, int len = -1 ); QCString copy() const; QCString &sprintf( const char *format, ... ); int find( char c, int index=0, bool cs=TRUE ) const; int find( const char *str, int index=0, bool cs=TRUE ) const; int find( const QRegExp &, int index=0 ) const; int findRev( char c, int index=-1, bool cs=TRUE) const; int findRev( const char *str, int index=-1, bool cs=TRUE) const; int findRev( const QRegExp &, int index=-1 ) const; int contains( char c, bool cs=TRUE ) const; int contains( const char *str, bool cs=TRUE ) const; int contains( const QRegExp & ) const; QCString left( uint len ) const; QCString right( uint len ) const; QCString mid( uint index, uint len=0xffffffff) const; QCString leftJustify( uint width, char fill=' ', bool trunc=FALSE)const; QCString rightJustify( uint width, char fill=' ',bool trunc=FALSE)const; QCString lower() const; QCString upper() const; QCString stripWhiteSpace() const; QCString simplifyWhiteSpace() const; QCString &insert( uint index, const char * ); QCString &insert( uint index, char ); QCString &append( const char * ); QCString &prepend( const char * ); QCString &remove( uint index, uint len ); QCString &replace( uint index, uint len, const char * ); QCString &replace( const QRegExp &, const char * ); QCString &replace( char c, const char *after ); QCString &replace( const char *, const char * ); QCString &replace( char, char ); short toShort( bool *ok=0 ) const; ushort toUShort( bool *ok=0 ) const; int toInt( bool *ok=0 ) const; uint toUInt( bool *ok=0 ) const; long toLong( bool *ok=0 ) const; ulong toULong( bool *ok=0 ) const; float toFloat( bool *ok=0 ) const; double toDouble( bool *ok=0 ) const; QCString &setStr( const char *s ); QCString &setNum( short ); QCString &setNum( ushort ); QCString &setNum( int ); QCString &setNum( uint ); QCString &setNum( long ); QCString &setNum( ulong ); QCString &setNum( float, char f='g', int prec=6 ); QCString &setNum( double, char f='g', int prec=6 ); bool setExpand( uint index, char c ); operator const char *() const; QCString &operator+=( const char *str ); QCString &operator+=( char c ); private: int find( const char *str, int index, bool cs, uint l ) const; }; QDataStream &operator<<( QDataStream &, const QCString & ); QDataStream &operator>>( QDataStream &, QCString & ); inline QCString &QCString::operator=( const QCString &s ) { return (QCString&)assign( s ); } inline QCString &QCString::operator=( const char *str ) { return (QCString&)duplicate( str, qstrlen(str)+1 ); } inline bool QCString::isNull() const { return data() == 0; } inline bool QCString::isEmpty() const { return data() == 0 || *data() == '\0'; } inline uint QCString::length() const { return qstrlen( data() ); } inline bool QCString::truncate( uint pos ) { return resize(pos+1); } inline QCString QCString::copy() const { return QCString( data() ); } inline QCString &QCString::prepend( const char *s ) { return insert(0,s); } inline QCString &QCString::append( const char *s ) { return operator+=(s); } inline QCString &QCString::setNum( short n ) { return setNum((long)n); } inline QCString &QCString::setNum( ushort n ) { return setNum((ulong)n); } inline QCString &QCString::setNum( int n ) { return setNum((long)n); } inline QCString &QCString::setNum( uint n ) { return setNum((ulong)n); } inline QCString &QCString::setNum( float n, char f, int prec ) { return setNum((double)n,f,prec); } inline QCString::operator const char *() const { return (const char *)data(); } inline bool operator==( const QCString &s1, const QCString &s2 ) { return qstrcmp( s1.data(), s2.data() ) == 0; } inline bool operator==( const QCString &s1, const char *s2 ) { return qstrcmp( s1.data(), s2 ) == 0; } inline bool operator==( const char *s1, const QCString &s2 ) { return qstrcmp( s1, s2.data() ) == 0; } inline bool operator!=( const QCString &s1, const QCString &s2 ) { return qstrcmp( s1.data(), s2.data() ) != 0; } inline bool operator!=( const QCString &s1, const char *s2 ) { return qstrcmp( s1.data(), s2 ) != 0; } inline bool operator!=( const char *s1, const QCString &s2 ) { return qstrcmp( s1, s2.data() ) != 0; } inline bool operator<( const QCString &s1, const QCString& s2 ) { return qstrcmp( s1.data(), s2.data() ) < 0; } inline bool operator<( const QCString &s1, const char *s2 ) { return qstrcmp( s1.data(), s2 ) < 0; } inline bool operator<( const char *s1, const QCString &s2 ) { return qstrcmp( s1, s2.data() ) < 0; } inline bool operator<=( const QCString &s1, const QCString &s2 ) { return qstrcmp( s1.data(), s2.data() ) <= 0; } inline bool operator<=( const QCString &s1, const char *s2 ) { return qstrcmp( s1.data(), s2 ) <= 0; } inline bool operator<=( const char *s1, const QCString &s2 ) { return qstrcmp( s1, s2.data() ) <= 0; } inline bool operator>( const QCString &s1, const QCString &s2 ) { return qstrcmp( s1.data(), s2.data() ) > 0; } inline bool operator>( const QCString &s1, const char *s2 ) { return qstrcmp( s1.data(), s2 ) > 0; } inline bool operator>( const char *s1, const QCString &s2 ) { return qstrcmp( s1, s2.data() ) > 0; } inline bool operator>=( const QCString &s1, const QCString& s2 ) { return qstrcmp( s1.data(), s2.data() ) >= 0; } inline bool operator>=( const QCString &s1, const char *s2 ) { return qstrcmp( s1.data(), s2 ) >= 0; } inline bool operator>=( const char *s1, const QCString &s2 ) { return qstrcmp( s1, s2.data() ) >= 0; } inline const QCString operator+( const QCString &s1, const QCString &s2 ) { QCString tmp( s1.data() ); tmp += s2; return tmp; } inline const QCString operator+( const QCString &s1, const char *s2 ) { QCString tmp( s1.data() ); tmp += s2; return tmp; } inline const QCString operator+( const char *s1, const QCString &s2 ) { QCString tmp( s1 ); tmp += s2; return tmp; } inline const QCString operator+( const QCString &s1, char c2 ) { QCString tmp( s1.data() ); tmp += c2; return tmp; } inline const QCString operator+( char c1, const QCString &s2 ) { QCString tmp; tmp += c1; tmp += s2; return tmp; } # 43 "/usr/lib/qt3/include/qstring.h" 2 # 57 "/usr/lib/qt3/include/qstring.h" class QRegExp; class QString; class QCharRef; template class QDeepCopy; class QChar { public: QChar(); QChar( char c ); QChar( uchar c ); QChar( uchar c, uchar r ); QChar( const QChar& c ); QChar( ushort rc ); QChar( short rc ); QChar( uint rc ); QChar( int rc ); static const QChar null; static const QChar replacement; static const QChar byteOrderMark; static const QChar byteOrderSwapped; static const QChar nbsp; enum Category { NoCategory, Mark_NonSpacing, Mark_SpacingCombining, Mark_Enclosing, Number_DecimalDigit, Number_Letter, Number_Other, Separator_Space, Separator_Line, Separator_Paragraph, Other_Control, Other_Format, Other_Surrogate, Other_PrivateUse, Other_NotAssigned, Letter_Uppercase, Letter_Lowercase, Letter_Titlecase, Letter_Modifier, Letter_Other, Punctuation_Connector, Punctuation_Dash, Punctuation_Dask = Punctuation_Dash, Punctuation_Open, Punctuation_Close, Punctuation_InitialQuote, Punctuation_FinalQuote, Punctuation_Other, Symbol_Math, Symbol_Currency, Symbol_Modifier, Symbol_Other }; enum Direction { DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON, DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN }; enum Decomposition { Single, Canonical, Font, NoBreak, Initial, Medial, Final, Isolated, Circle, Super, Sub, Vertical, Wide, Narrow, Small, Square, Compat, Fraction }; enum Joining { OtherJoining, Dual, Right, Center }; enum CombiningClass { Combining_BelowLeftAttached = 200, Combining_BelowAttached = 202, Combining_BelowRightAttached = 204, Combining_LeftAttached = 208, Combining_RightAttached = 210, Combining_AboveLeftAttached = 212, Combining_AboveAttached = 214, Combining_AboveRightAttached = 216, Combining_BelowLeft = 218, Combining_Below = 220, Combining_BelowRight = 222, Combining_Left = 224, Combining_Right = 226, Combining_AboveLeft = 228, Combining_Above = 230, Combining_AboveRight = 232, Combining_DoubleBelow = 233, Combining_DoubleAbove = 234, Combining_IotaSubscript = 240 }; int digitValue() const; QChar lower() const; QChar upper() const; Category category() const; Direction direction() const; Joining joining() const; bool mirrored() const; QChar mirroredChar() const; const QString &decomposition() const; Decomposition decompositionTag() const; unsigned char combiningClass() const; char latin1() const { return ucs > 0xff ? 0 : (char) ucs; } ushort unicode() const { return ucs; } ushort &unicode() { return ucs; } operator char() const { return latin1(); } bool isNull() const { return unicode()==0; } bool isPrint() const; bool isPunct() const; bool isSpace() const; bool isMark() const; bool isLetter() const; bool isNumber() const; bool isLetterOrNumber() const; bool isDigit() const; bool isSymbol() const; uchar cell() const { return ((uchar) ucs & 0xff); } uchar row() const { return ((uchar) (ucs>>8)&0xff); } void setCell( uchar cell ) { ucs = (ucs & 0xff00) + cell; } void setRow( uchar row ) { ucs = (((ushort) row)<<8) + (ucs&0xff); } static bool networkOrdered() { int wordSize; bool bigEndian = FALSE; qSysInfo( &wordSize, &bigEndian ); return bigEndian; } friend inline bool operator==( char ch, QChar c ); friend inline bool operator==( QChar c, char ch ); friend inline bool operator==( QChar c1, QChar c2 ); friend inline bool operator!=( QChar c1, QChar c2 ); friend inline bool operator!=( char ch, QChar c ); friend inline bool operator!=( QChar c, char ch ); friend inline bool operator<=( QChar c, char ch ); friend inline bool operator<=( char ch, QChar c ); friend inline bool operator<=( QChar c1, QChar c2 ); private: ushort ucs; } ; inline QChar::QChar() : ucs( 0 ) { } inline QChar::QChar( char c ) : ucs( (uchar)c ) { } inline QChar::QChar( uchar c ) : ucs( c ) { } inline QChar::QChar( uchar c, uchar r ) : ucs( (r << 8) | c ) { } inline QChar::QChar( const QChar& c ) : ucs( c.ucs ) { } inline QChar::QChar( ushort rc ) : ucs( rc ) { } inline QChar::QChar( short rc ) : ucs( (ushort) rc ) { } inline QChar::QChar( uint rc ) : ucs( (ushort ) (rc & 0xffff) ) { } inline QChar::QChar( int rc ) : ucs( (ushort) (rc & 0xffff) ) { } inline bool operator==( char ch, QChar c ) { return ((uchar) ch) == c.ucs; } inline bool operator==( QChar c, char ch ) { return ((uchar) ch) == c.ucs; } inline bool operator==( QChar c1, QChar c2 ) { return c1.ucs == c2.ucs; } inline bool operator!=( QChar c1, QChar c2 ) { return c1.ucs != c2.ucs; } inline bool operator!=( char ch, QChar c ) { return ((uchar)ch) != c.ucs; } inline bool operator!=( QChar c, char ch ) { return ((uchar) ch) != c.ucs; } inline bool operator<=( QChar c, char ch ) { return c.ucs <= ((uchar) ch); } inline bool operator<=( char ch, QChar c ) { return ((uchar) ch) <= c.ucs; } inline bool operator<=( QChar c1, QChar c2 ) { return c1.ucs <= c2.ucs; } inline bool operator>=( QChar c, char ch ) { return ch <= c; } inline bool operator>=( char ch, QChar c ) { return c <= ch; } inline bool operator>=( QChar c1, QChar c2 ) { return c2 <= c1; } inline bool operator<( QChar c, char ch ) { return !(ch<=c); } inline bool operator<( char ch, QChar c ) { return !(c<=ch); } inline bool operator<( QChar c1, QChar c2 ) { return !(c2<=c1); } inline bool operator>( QChar c, char ch ) { return !(ch>=c); } inline bool operator>( char ch, QChar c ) { return !(c>=ch); } inline bool operator>( QChar c1, QChar c2 ) { return !(c2>=c1); } struct QStringData : public QShared { QStringData() : QShared(), unicode(0), ascii(0), len(0), issimpletext(TRUE), maxl(0), islatin1(FALSE) { ref(); } QStringData(QChar *u, uint l, uint m) : QShared(), unicode(u), ascii(0), len(l), issimpletext(FALSE), maxl(m), islatin1(FALSE) { } ~QStringData() { if ( unicode ) delete[] ((char*)unicode); if ( ascii ) delete[] ascii; } void deleteSelf(); QChar *unicode; char *ascii; void setDirty() { if ( ascii ) { delete [] ascii; ascii = 0; } issimpletext = FALSE; } uint len : 30; uint issimpletext : 1; uint maxl : 30; uint islatin1 : 1; private: QStringData( const QStringData& ); QStringData& operator=( const QStringData& ); }; class QString { public: QString(); QString( QChar ); QString( const QString & ); QString( const QByteArray& ); QString( const QChar* unicode, uint length ); QString( const char *str ); ~QString(); QString &operator=( const QString & ); QString &operator=( const char * ); QString &operator=( const QCString& ); QString &operator=( QChar c ); QString &operator=( char c ); static const QString null; bool isNull() const; bool isEmpty() const; uint length() const; void truncate( uint pos ); QString & fill( QChar c, int len = -1 ); QString copy() const; QString arg( long a, int fieldwidth=0, int base=10 ) const; QString arg( ulong a, int fieldwidth=0, int base=10 ) const; QString arg( int a, int fieldwidth=0, int base=10 ) const; QString arg( uint a, int fieldwidth=0, int base=10 ) const; QString arg( short a, int fieldwidth=0, int base=10 ) const; QString arg( ushort a, int fieldwidth=0, int base=10 ) const; QString arg( char a, int fieldwidth=0 ) const; QString arg( QChar a, int fieldwidth=0 ) const; QString arg( const QString& a, int fieldwidth=0 ) const; QString arg( double a, int fieldwidth=0, char fmt='g', int prec=-1 ) const; QString &sprintf( const char* format, ... ) __attribute__ ((format (printf, 2, 3))) ; int find( QChar c, int index=0, bool cs=TRUE ) const; int find( char c, int index=0, bool cs=TRUE ) const; int find( const QString &str, int index=0, bool cs=TRUE ) const; int find( const QRegExp &, int index=0 ) const; int find( const char* str, int index=0 ) const; int findRev( QChar c, int index=-1, bool cs=TRUE) const; int findRev( char c, int index=-1, bool cs=TRUE) const; int findRev( const QString &str, int index=-1, bool cs=TRUE) const; int findRev( const QRegExp &, int index=-1 ) const; int findRev( const char* str, int index=-1 ) const; int contains( QChar c, bool cs=TRUE ) const; int contains( char c, bool cs=TRUE ) const { return contains(QChar(c), cs); } int contains( const char* str, bool cs=TRUE ) const; int contains( const QString &str, bool cs=TRUE ) const; int contains( const QRegExp & ) const; enum SectionFlags { SectionDefault = 0x00, SectionSkipEmpty = 0x01, SectionIncludeLeadingSep = 0x02, SectionIncludeTrailingSep = 0x04, SectionCaseInsensitiveSeps = 0x08 }; QString section( QChar sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; QString section( char sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; QString section( const char *in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; QString section( const QString &in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; QString section( const QRegExp ®, int start, int end = 0xffffffff, int flags = SectionDefault ) const; QString left( uint len ) const; QString right( uint len ) const; QString mid( uint index, uint len=0xffffffff) const; QString leftJustify( uint width, QChar fill=' ', bool trunc=FALSE)const; QString rightJustify( uint width, QChar fill=' ',bool trunc=FALSE)const; QString lower() const; QString upper() const; QString stripWhiteSpace() const; QString simplifyWhiteSpace() const; QString &insert( uint index, const QString & ); QString &insert( uint index, const QChar*, uint len ); QString &insert( uint index, QChar ); QString &insert( uint index, char c ) { return insert(index,QChar(c)); } QString &append( char ); QString &append( QChar ); QString &append( const QString & ); QString &append( const QByteArray & ); QString &append( const char * ); QString &prepend( char ); QString &prepend( QChar ); QString &prepend( const QString & ); QString &prepend( const QByteArray & ); QString &prepend( const char * ); QString &remove( uint index, uint len ); QString &remove( QChar c ); QString &remove( char c ) { return remove( QChar(c) ); } QString &remove( const QString & ); QString &remove( const QRegExp & ); QString &remove( const char * ); QString &replace( uint index, uint len, const QString & ); QString &replace( uint index, uint len, const QChar*, uint clen ); QString &replace( uint index, uint len, QChar ); QString &replace( uint index, uint len, char c ) { return replace( index, len, QChar(c) ); } QString &replace( QChar c, const QString & ); QString &replace( char c, const QString & after ) { return replace( QChar(c), after ); } QString &replace( const QString &, const QString & ); QString &replace( const QRegExp &, const QString & ); QString &replace( QChar, QChar ); short toShort( bool *ok=0, int base=10 ) const; ushort toUShort( bool *ok=0, int base=10 ) const; int toInt( bool *ok=0, int base=10 ) const; uint toUInt( bool *ok=0, int base=10 ) const; long toLong( bool *ok=0, int base=10 ) const; ulong toULong( bool *ok=0, int base=10 ) const; float toFloat( bool *ok=0 ) const; double toDouble( bool *ok=0 ) const; QString &setNum( short, int base=10 ); QString &setNum( ushort, int base=10 ); QString &setNum( int, int base=10 ); QString &setNum( uint, int base=10 ); QString &setNum( long, int base=10 ); QString &setNum( ulong, int base=10 ); QString &setNum( float, char f='g', int prec=6 ); QString &setNum( double, char f='g', int prec=6 ); static QString number( long, int base=10 ); static QString number( ulong, int base=10); static QString number( int, int base=10 ); static QString number( uint, int base=10); static QString number( double, char f='g', int prec=6 ); void setExpand( uint index, QChar c ); QString &operator+=( const QString &str ); QString &operator+=( const QByteArray &str ); QString &operator+=( const char *str ); QString &operator+=( QChar c ); QString &operator+=( char c ); QChar at( uint i ) const { return i < d->len ? d->unicode[i] : QChar::null; } QChar operator[]( int i ) const { return at((uint)i); } QCharRef at( uint i ); QCharRef operator[]( int i ); QChar constref(uint i) const { return at(i); } QChar& ref(uint i) { if ( d->count != 1 || i >= d->len ) subat( i ); d->setDirty(); return d->unicode[i]; } const QChar* unicode() const { return d->unicode; } const char* ascii() const; static QString fromAscii(const char*, int len=-1); const char* latin1() const; static QString fromLatin1(const char*, int len=-1); QCString utf8() const; static QString fromUtf8(const char*, int len=-1); QCString local8Bit() const; static QString fromLocal8Bit(const char*, int len=-1); bool operator!() const; operator const char *() const { return ascii(); } static QString fromUcs2( const unsigned short *ucs2 ); const unsigned short *ucs2() const; QString &setUnicode( const QChar* unicode, uint len ); QString &setUnicodeCodes( const ushort* unicode_as_ushorts, uint len ); QString &setAscii( const char*, int len=-1 ); QString &setLatin1( const char*, int len=-1 ); int compare( const QString& s ) const; static int compare( const QString& s1, const QString& s2 ) { return s1.compare( s2 ); } int localeAwareCompare( const QString& s ) const; static int localeAwareCompare( const QString& s1, const QString& s2 ) { return s1.localeAwareCompare( s2 ); } friend QDataStream &operator>>( QDataStream &, QString & ); void compose(); const char* data() const { return ascii(); } bool startsWith( const QString& ) const; bool endsWith( const QString& ) const; void setLength( uint newLength ); bool simpleText() const { if ( !d->issimpletext ) checkSimpleText(); return (bool)d->issimpletext; } bool isRightToLeft() const; private: QString( int size, bool ); void deref(); void real_detach(); void subat( uint ); bool findArg(int& pos, int& len) const; void checkSimpleText() const; static QChar* latin1ToUnicode( const char*, uint * len, uint maxlen=(uint)-1 ); static QChar* latin1ToUnicode( const QByteArray&, uint * len ); static char* unicodeToLatin1( const QChar*, uint len ); QStringData *d; static QStringData* shared_null; static QStringData* makeSharedNull(); friend class QConstString; friend class QTextStream; QString( QStringData* dd, bool ) : d(dd) { } void detach(); friend class QDeepCopy; }; class QCharRef { friend class QString; QString& s; uint p; QCharRef(QString* str, uint pos) : s(*str), p(pos) { } public: ushort unicode() const { return s.constref(p).unicode(); } char latin1() const { return s.constref(p).latin1(); } QCharRef operator=(char c ) { s.ref(p)=c; return *this; } QCharRef operator=(uchar c ) { s.ref(p)=c; return *this; } QCharRef operator=(QChar c ) { s.ref(p)=c; return *this; } QCharRef operator=(const QCharRef& c ) { s.ref(p)=c.unicode(); return *this; } QCharRef operator=(ushort rc ) { s.ref(p)=rc; return *this; } QCharRef operator=(short rc ) { s.ref(p)=rc; return *this; } QCharRef operator=(uint rc ) { s.ref(p)=rc; return *this; } QCharRef operator=(int rc ) { s.ref(p)=rc; return *this; } operator QChar () const { return s.constref(p); } bool isNull() const { return unicode()==0; } bool isPrint() const { return s.constref(p).isPrint(); } bool isPunct() const { return s.constref(p).isPunct(); } bool isSpace() const { return s.constref(p).isSpace(); } bool isMark() const { return s.constref(p).isMark(); } bool isLetter() const { return s.constref(p).isLetter(); } bool isNumber() const { return s.constref(p).isNumber(); } bool isLetterOrNumber() { return s.constref(p).isLetterOrNumber(); } bool isDigit() const { return s.constref(p).isDigit(); } int digitValue() const { return s.constref(p).digitValue(); } QChar lower() const { return s.constref(p).lower(); } QChar upper() const { return s.constref(p).upper(); } QChar::Category category() const { return s.constref(p).category(); } QChar::Direction direction() const { return s.constref(p).direction(); } QChar::Joining joining() const { return s.constref(p).joining(); } bool mirrored() const { return s.constref(p).mirrored(); } QChar mirroredChar() const { return s.constref(p).mirroredChar(); } const QString &decomposition() const { return s.constref(p).decomposition(); } QChar::Decomposition decompositionTag() const { return s.constref(p).decompositionTag(); } unsigned char combiningClass() const { return s.constref(p).combiningClass(); } uchar cell() const { return s.constref(p).cell(); } uchar row() const { return s.constref(p).row(); } }; inline QCharRef QString::at( uint i ) { return QCharRef(this,i); } inline QCharRef QString::operator[]( int i ) { return at((uint)i); } class QConstString : private QString { public: QConstString( const QChar* unicode, uint length ); ~QConstString(); const QString& string() const { return *this; } }; QDataStream &operator<<( QDataStream &, const QString & ); QDataStream &operator>>( QDataStream &, QString & ); # 761 "/usr/lib/qt3/include/qstring.h" inline QString::QString() : d(shared_null ? shared_null : makeSharedNull()) { d->ref(); } inline QString::~QString() { if ( d->deref() ) { if ( d != shared_null ) d->deleteSelf(); } } inline void QString::detach() { real_detach(); } inline QString QString::section( QChar sep, int start, int end, int flags ) const { return section(QString(sep), start, end, flags); } inline QString QString::section( char sep, int start, int end, int flags ) const { return section(QChar(sep), start, end, flags); } inline QString QString::section( const char *in_sep, int start, int end, int flags ) const { return section(QString(in_sep), start, end, flags); } inline QString &QString::operator=( QChar c ) { *this = QString(c); return *this; } inline QString &QString::operator=( char c ) { *this = QString(QChar(c)); return *this; } inline bool QString::isNull() const { return unicode() == 0; } inline bool QString::operator!() const { return isNull(); } inline uint QString::length() const { return d->len; } inline bool QString::isEmpty() const { return length() == 0; } inline QString QString::copy() const { return QString( *this ); } inline QString &QString::prepend( const QString & s ) { return insert(0,s); } inline QString &QString::prepend( QChar c ) { return insert(0,c); } inline QString &QString::prepend( char c ) { return insert(0,c); } inline QString &QString::prepend( const QByteArray & s ) { return insert(0,s.data()); } inline QString &QString::append( const QString & s ) { return operator+=(s); } inline QString &QString::append( const QByteArray &s ) { return operator+=(s.data()); } inline QString &QString::append( const char * s ) { return operator+=(s); } inline QString &QString::append( QChar c ) { return operator+=(c); } inline QString &QString::append( char c ) { return operator+=(c); } inline QString &QString::operator+=( const QByteArray &s ) { return operator+=(s.data()); } # 859 "/usr/lib/qt3/include/qstring.h" inline QString &QString::setNum( short n, int base ) { return setNum((long)n, base); } inline QString &QString::setNum( ushort n, int base ) { return setNum((ulong)n, base); } inline QString &QString::setNum( int n, int base ) { return setNum((long)n, base); } inline QString &QString::setNum( uint n, int base ) { return setNum((ulong)n, base); } inline QString &QString::setNum( float n, char f, int prec ) { return setNum((double)n,f,prec); } inline QString QString::arg(int a, int fieldwidth, int base) const { return arg((long)a, fieldwidth, base); } inline QString QString::arg(uint a, int fieldwidth, int base) const { return arg((ulong)a, fieldwidth, base); } inline QString QString::arg(short a, int fieldwidth, int base) const { return arg((long)a, fieldwidth, base); } inline QString QString::arg(ushort a, int fieldwidth, int base) const { return arg((ulong)a, fieldwidth, base); } inline int QString::find( char c, int index, bool cs ) const { return find(QChar(c), index, cs); } inline int QString::findRev( char c, int index, bool cs) const { return findRev( QChar(c), index, cs ); } inline int QString::find( const char* str, int index ) const { return find(QString::fromAscii(str), index); } inline int QString::findRev( const char* str, int index ) const { return findRev(QString::fromAscii(str), index); } bool operator!=( const QString &s1, const QString &s2 ); bool operator<( const QString &s1, const QString &s2 ); bool operator<=( const QString &s1, const QString &s2 ); bool operator==( const QString &s1, const QString &s2 ); bool operator>( const QString &s1, const QString &s2 ); bool operator>=( const QString &s1, const QString &s2 ); bool operator!=( const QString &s1, const char *s2 ); bool operator<( const QString &s1, const char *s2 ); bool operator<=( const QString &s1, const char *s2 ); bool operator==( const QString &s1, const char *s2 ); bool operator>( const QString &s1, const char *s2 ); bool operator>=( const QString &s1, const char *s2 ); bool operator!=( const char *s1, const QString &s2 ); bool operator<( const char *s1, const QString &s2 ); bool operator<=( const char *s1, const QString &s2 ); bool operator==( const char *s1, const QString &s2 ); bool operator>=( const char *s1, const QString &s2 ); inline const QString operator+( const QString &s1, const QString &s2 ) { QString tmp( s1 ); tmp += s2; return tmp; } inline const QString operator+( const QString &s1, const char *s2 ) { QString tmp( s1 ); tmp += QString::fromAscii(s2); return tmp; } inline const QString operator+( const char *s1, const QString &s2 ) { QString tmp = QString::fromAscii( s1 ); tmp += s2; return tmp; } inline const QString operator+( const QString &s1, QChar c2 ) { QString tmp( s1 ); tmp += c2; return tmp; } inline const QString operator+( const QString &s1, char c2 ) { QString tmp( s1 ); tmp += c2; return tmp; } inline const QString operator+( QChar c1, const QString &s2 ) { QString tmp; tmp += c1; tmp += s2; return tmp; } inline const QString operator+( char c1, const QString &s2 ) { QString tmp; tmp += c1; tmp += s2; return tmp; } # 8 "bug.cpp" 2 void tester(QString str) { } int main(int argc, char** argv) { QString str("bug"); while (true) tester("ops: " + str); } --Boundary-00=_VqqX+2CdDYIEEST Content-Type: application/octet-stream; name="bug.s" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bug.s" .file "bug.cpp" .text .align 2 .globl _Z6tester7QString .type _Z6tester7QString,@function _Z6tester7QString: .LFB1: pushl %ebp .LCFI0: movl %esp, %ebp .LCFI1: popl %ebp ret .LFE1: .Lfe1: .size _Z6tester7QString,.Lfe1-_Z6tester7QString .globl _Unwind_Resume .section .rodata .LC0: .string "bug" .LC1: .string "ops: " .text .align 2 .globl main .type main,@function main: .LFB2: pushl %ebp .LCFI2: movl %esp, %ebp .LCFI3: pushl %ebx .LCFI4: subl $52, %esp .LCFI5: andl $-16, %esp movl $0, %eax subl %eax, %esp subl $8, %esp pushl $.LC0 leal -24(%ebp), %eax pushl %eax .LEHB0: .LCFI6: call _ZN7QStringC1EPKc .LEHE0: addl $16, %esp .L3: leal -40(%ebp), %edx subl $4, %esp leal -24(%ebp), %eax pushl %eax pushl $.LC1 pushl %edx .LEHB1: call _ZplPKcRK7QString .LEHE1: addl $12, %esp subl $12, %esp leal -40(%ebp), %eax pushl %eax call _Z6tester7QString addl $16, %esp jmp .L3 .L10: movl %eax, -44(%ebp) movl -44(%ebp), %ebx subl $12, %esp leal -24(%ebp), %eax pushl %eax call _ZN7QStringD1Ev addl $16, %esp movl %ebx, -44(%ebp) subl $12, %esp pushl -44(%ebp) .LEHB2: call _Unwind_Resume .LEHE2: .LFE2: .Lfe2: .size main,.Lfe2-main .section .gcc_except_table,"aw",@progbits .LLSDA2: .byte 0xff .byte 0xff .byte 0x1 .uleb128 .LLSDACSE2-.LLSDACSB2 .LLSDACSB2: .uleb128 .LEHB0-.LFB2 .uleb128 .LEHE0-.LEHB0 .uleb128 0x0 .uleb128 0x0 .uleb128 .LEHB1-.LFB2 .uleb128 .LEHE1-.LEHB1 .uleb128 .L10-.LFB2 .uleb128 0x0 .uleb128 .LEHB2-.LFB2 .uleb128 .LEHE2-.LEHB2 .uleb128 0x0 .uleb128 0x0 .LLSDACSE2: .text .section .gnu.linkonce.t._ZN7QStringD1Ev,"ax",@progbits .align 2 .weak _ZN7QStringD1Ev .type _ZN7QStringD1Ev,@function _ZN7QStringD1Ev: .LFB3: pushl %ebp .LCFI7: movl %esp, %ebp .LCFI8: subl $8, %esp .LCFI9: subl $12, %esp movl 8(%ebp), %eax pushl (%eax) .LCFI10: call _ZN7QShared5derefEv addl $16, %esp testb %al, %al je .L11 movl 8(%ebp), %eax movl (%eax), %eax cmpl _ZN7QString11shared_nullE, %eax je .L11 subl $12, %esp movl 8(%ebp), %eax pushl (%eax) call _ZN11QStringData10deleteSelfEv addl $16, %esp .L11: leave ret .LFE3: .Lfe3: .size _ZN7QStringD1Ev,.Lfe3-_ZN7QStringD1Ev .section .gnu.linkonce.t._ZplPKcRK7QString,"ax",@progbits .align 2 .weak _ZplPKcRK7QString .type _ZplPKcRK7QString,@function _ZplPKcRK7QString: .LFB4: pushl %ebp .LCFI11: movl %esp, %ebp .LCFI12: pushl %ebx .LCFI13: subl $4, %esp .LCFI14: subl $4, %esp pushl $-1 pushl 12(%ebp) pushl 8(%ebp) .LEHB3: .LCFI15: call _ZN7QString9fromAsciiEPKci .LEHE3: addl $12, %esp subl $8, %esp pushl 16(%ebp) pushl 8(%ebp) .LEHB4: call _ZN7QStringpLERKS_ .LEHE4: addl $16, %esp jmp .L16 .L21: movl %eax, -8(%ebp) movl -8(%ebp), %ebx subl $12, %esp pushl 8(%ebp) call _ZN7QStringD1Ev addl $16, %esp movl %ebx, -8(%ebp) subl $12, %esp pushl -8(%ebp) .LEHB5: call _Unwind_Resume .LEHE5: .L16: movl 8(%ebp), %eax movl -4(%ebp), %ebx leave ret $4 .LFE4: .Lfe4: .size _ZplPKcRK7QString,.Lfe4-_ZplPKcRK7QString .section .gcc_except_table .LLSDA4: .byte 0xff .byte 0xff .byte 0x1 .uleb128 .LLSDACSE4-.LLSDACSB4 .LLSDACSB4: .uleb128 .LEHB3-.LFB4 .uleb128 .LEHE3-.LEHB3 .uleb128 0x0 .uleb128 0x0 .uleb128 .LEHB4-.LFB4 .uleb128 .LEHE4-.LEHB4 .uleb128 .L21-.LFB4 .uleb128 0x0 .uleb128 .LEHB5-.LFB4 .uleb128 .LEHE5-.LEHB5 .uleb128 0x0 .uleb128 0x0 .LLSDACSE4: .section .gnu.linkonce.t._ZplPKcRK7QString .section .rodata .type FALSE,@object .size FALSE,1 FALSE: .byte 0 .type TRUE,@object .size TRUE,1 TRUE: .byte 1 .section .gnu.linkonce.t._ZN7QShared5derefEv,"ax",@progbits .align 2 .weak _ZN7QShared5derefEv .type _ZN7QShared5derefEv,@function _ZN7QShared5derefEv: .LFB5: pushl %ebp .LCFI16: movl %esp, %ebp .LCFI17: movl 8(%ebp), %eax decl (%eax) cmpl $0, (%eax) sete %al andl $255, %eax popl %ebp ret .LFE5: .Lfe5: .size _ZN7QShared5derefEv,.Lfe5-_ZN7QShared5derefEv .section .eh_frame,"aw",@progbits .Lframe1: .long .LECIE1-.LSCIE1 .LSCIE1: .long 0x0 .byte 0x1 .string "zPL" .uleb128 0x1 .sleb128 -4 .byte 0x8 .uleb128 0x6 .byte 0x0 .long __gxx_personality_v0 .byte 0x0 .byte 0xc .uleb128 0x4 .uleb128 0x4 .byte 0x88 .uleb128 0x1 .align 4 .LECIE1: .LSFDE3: .long .LEFDE3-.LASFDE3 .LASFDE3: .long .LASFDE3-.Lframe1 .long .LFB2 .long .LFE2-.LFB2 .uleb128 0x4 .long .LLSDA2 .byte 0x4 .long .LCFI2-.LFB2 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI3-.LCFI2 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI5-.LCFI3 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI6-.LCFI5 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE3: .LSFDE5: .long .LEFDE5-.LASFDE5 .LASFDE5: .long .LASFDE5-.Lframe1 .long .LFB3 .long .LFE3-.LFB3 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI7-.LFB3 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI8-.LCFI7 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI10-.LCFI8 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE5: .LSFDE7: .long .LEFDE7-.LASFDE7 .LASFDE7: .long .LASFDE7-.Lframe1 .long .LFB4 .long .LFE4-.LFB4 .uleb128 0x4 .long .LLSDA4 .byte 0x4 .long .LCFI11-.LFB4 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI12-.LCFI11 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI14-.LCFI12 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI15-.LCFI14 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE7: .ident "GCC: (GNU) 3.2" --Boundary-00=_VqqX+2CdDYIEEST--