This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs-2.91.40 and Qt (was:Re: latest snapshot doesn't compile)


Am Fri, 12 Jun 1998 schrieb Arnt Gulbrandsen:
>Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
>> egcs-2.91.40 19980612
>
>Hm.  I build Qt using gcc version egcs-2.90.29 980515 (egcs-1.0.3
>release) with no warnings...
>
>What does this program do?
>
>--- cut here ---
>
>#include <qstring.h>
>
>int main( int argc, char ** argv ) {
>    QString a( "stuff" );
>    const char * b = a;
>    printf( "->%s<-\n", b );
>}
>
>--- cut here ---
>
>That gives the warning, not?  What if you remove the operator const
>char * from qstring.h?  Does the program give warnings?  Does it work?
>
>I just can't see where egcs gets that other operator const char *
>from, and why it considers that other one to be worth consideration.
>I mean, the object is of type QString and QString itself provides an
>operator const char *: Why should the compiler even start looking for
>any other ways to cast?
>
>--Arnt

Yes, you are right, this small example gives a lot of the same errors, but
works correctly. I've cc'ed egcs-bugs and appended the .ii file of the
testcase, cause I really don't know a lot about c++.

Franz.

/usr/lib/qt/include/qstring.h: In function `class QString operator +(const class QString &, const class QString &)':
In file included from qstring.cc:2:
/usr/lib/qt/include/qstring.h:339: warning: choosing `QString::operator const char *() const' over `QArrayT<char>::operator const char *<char>() const'
/usr/lib/qt/include/qstring.h:339: warning:   for conversion from `const QString' to `const char *'
/usr/lib/qt/include/qstring.h:339: warning:   because conversion sequence for the argument is better
/usr/lib/qt/include/qstring.h: In function `class QString operator +(const char *, const class QString &)':
/usr/lib/qt/include/qstring.h:353: warning: choosing `QString::operator const char *() const' over `QArrayT<char>::operator const char *<char>() const'
/usr/lib/qt/include/qstring.h:353: warning:   for conversion from `const QString' to `const char *'
/usr/lib/qt/include/qstring.h:353: warning:   because conversion sequence for the argument is better
/usr/lib/qt/include/qstring.h: In function `class QString operator +(char, const class QString &)':
/usr/lib/qt/include/qstring.h:367: warning: choosing `QString::operator const char *() const' over `QArrayT<char>::operator const char *<char>() const'
/usr/lib/qt/include/qstring.h:367: warning:   for conversion from `const QString' to `const char *'
/usr/lib/qt/include/qstring.h:367: warning:   because conversion sequence for the argument is better
qstring.cc: In function `int main(int, char **)':
qstring.cc:7: warning: choosing `QString::operator const char *() const' over `QArrayT<char>::operator const char *<char>() const'
qstring.cc:7: warning:   for conversion from `QString' to `const char *'
qstring.cc:7: warning:   because conversion sequence for the argument is better
qstring.cc:8: warning: implicit declaration of function `int printf(...)'


# 1 "qstring.cc"

# 1 "/usr/lib/qt/include/qstring.h" 1
 


























# 1 "/usr/lib/qt/include/qarray.h" 1
 

























# 1 "/usr/lib/qt/include/qgarray.h" 1
 

























# 1 "/usr/lib/qt/include/qshared.h" 1
 

























# 1 "/usr/lib/qt/include/qglobal.h" 1
 





























 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

# 80 "/usr/lib/qt/include/qglobal.h"


# 108 "/usr/lib/qt/include/qglobal.h"










 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

# 150 "/usr/lib/qt/include/qglobal.h"


# 180 "/usr/lib/qt/include/qglobal.h"







 
 
 





 
 
 










 
 
 


















 
 
 





# 245 "/usr/lib/qt/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;



 
 
 





inline int qRound( double d )
{
    return d > 0.0 ? int(d+0.5) : int(d-0.5);
}


 
 
 


typedef char		INT8;			 
typedef unsigned char	UINT8;			 
typedef short		INT16;			 
typedef unsigned short	UINT16;			 
typedef int		INT32;			 
typedef unsigned int	UINT32;			 


typedef 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;		 


 
 
 

class QDataStream;


 
 
 

const char *qVersion();
bool qSysInfo( int *wordSize, bool *bigEndian );


 
 
 












 
 
 
 





# 359 "/usr/lib/qt/include/qglobal.h"



 
 
 





 
 
 





 
 
 









 
 
 











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)))

;









bool chk_pointer( bool c, const char *, int );	 







enum QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg };

typedef void (*msg_handler)(QtMsgType, const char *);
msg_handler qInstallMsgHandler( 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 );




# 27 "/usr/lib/qt/include/qshared.h" 2




struct QShared
{
    QShared()		{ count = 1; }
    void ref()		{ count++; }
    bool deref()	{ return !--count; }
    uint count;
};



# 27 "/usr/lib/qt/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();
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 );

    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;

    char       *at( uint index ) const;

    bool	setExpand( uint index, const char *d, uint sz );

protected:
    virtual array_data *newData()		    { return new array_data; }
    virtual void	deleteData( array_data *p ) { delete 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];
}



# 27 "/usr/lib/qt/include/qarray.h" 2






# 1 "/usr/lib/qt/include/qgeneric.h" 1
 





























 





 
 










 
 



















# 33 "/usr/lib/qt/include/qarray.h" 2














# 95 "/usr/lib/qt/include/qarray.h"











template<class type> class QArrayT : public QGArray
{
protected:
    QArrayT( int, int ) : QGArray( 0, 0 ) {}
public:
    QArrayT()			{}
    QArrayT( int size ) : QGArray(size*sizeof(type)) {}
    QArrayT( const QArrayT<type> &a ) : QGArray(a) {}
   ~QArrayT()			{}
    QArrayT<type> &operator=(const QArrayT<type> &a)
				{ return (QArrayT<type>&)QGArray::assign(a); }
    type *data()    const	{ return (type *)QGArray::data(); }
    uint  nrefs()   const	{ return QGArray::nrefs(); }
    uint  size()    const	{ return QGArray::size()/sizeof(type); }
    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  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(); }
    QArrayT<type>   copy() const
	{ QArrayT<type> tmp; return tmp.duplicate(*this); }
    QArrayT<type>& assign( const QArrayT<type>& a )
	{ return (QArrayT<type>&)QGArray::assign(a); }
    QArrayT<type>& assign( const type *a, uint n )
	{ return (QArrayT<type>&)QGArray::assign((char*)a,n*sizeof(type)); }
    QArrayT<type>& duplicate( const QArrayT<type>& a )
	{ return (QArrayT<type>&)QGArray::duplicate(a); }
    QArrayT<type>& duplicate( const type *a, uint n )
	{ return (QArrayT<type>&)QGArray::duplicate((char*)a,n*sizeof(type)); }
    QArrayT<type>& setRawData( const type *a, uint n )
	{ return (QArrayT<type>&)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)); }
    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 QArrayT<type> &a ) const { return isEqual(a); }
    bool operator!=( const QArrayT<type> &a ) const { return !isEqual(a); }
};






# 28 "/usr/lib/qt/include/qstring.h" 2



# 1 "/usr/include/string.h" 1 3 4
 

















 






# 1 "/usr/include/features.h" 1 3 4
 




















 
























































 


















 





 



 







 
# 134 "/usr/include/features.h" 3 4


 









 





 























# 188 "/usr/include/features.h" 3 4


































 



 








 




 

# 1 "/usr/include/sys/cdefs.h" 1 3 4
 




















# 1 "/usr/include/features.h" 1 3 4
 

















# 267 "/usr/include/features.h" 3 4

# 22 "/usr/include/sys/cdefs.h" 2 3 4


 







# 54 "/usr/include/sys/cdefs.h" 3 4


 







 



# 86 "/usr/include/sys/cdefs.h" 3 4



 








 















 








 








 




# 242 "/usr/include/features.h" 2 3 4


 








 

 








# 1 "/usr/include/gnu/stubs.h" 1 3 4
 


























# 264 "/usr/include/features.h" 2 3 4




# 26 "/usr/include/string.h" 2 3 4


extern "C" { 

 


# 1 "/usr/lib/gcc-lib/powerpc-unknown-linux-gnu/egcs-2.91.40/include/stddef.h" 1 3 4






 


# 19 "/usr/lib/gcc-lib/powerpc-unknown-linux-gnu/egcs-2.91.40/include/stddef.h" 3 4



 


 





 


# 61 "/usr/lib/gcc-lib/powerpc-unknown-linux-gnu/egcs-2.91.40/include/stddef.h" 3 4


 





 


















 





 

 

# 131 "/usr/lib/gcc-lib/powerpc-unknown-linux-gnu/egcs-2.91.40/include/stddef.h" 3 4


 

 


































typedef unsigned int size_t;






















 




 

# 271 "/usr/lib/gcc-lib/powerpc-unknown-linux-gnu/egcs-2.91.40/include/stddef.h" 3 4


# 283 "/usr/lib/gcc-lib/powerpc-unknown-linux-gnu/egcs-2.91.40/include/stddef.h" 3 4


 

 

# 317 "/usr/lib/gcc-lib/powerpc-unknown-linux-gnu/egcs-2.91.40/include/stddef.h" 3 4




 





















# 33 "/usr/include/string.h" 2 3 4



 
extern void *  memcpy  (void *    __dest,
			    __const void *    __src, size_t __n)  ;
 

extern void *  memmove  (void *  __dest, __const void *  __src,
			     size_t __n)  ;

 


extern void *  __memccpy  (void *  __dest, __const void *  __src,
			       int __c, size_t __n)  ;

extern void *  memccpy  (void *  __dest, __const void *  __src,
			     int __c, size_t __n)  ;



 
extern void *  memset  (void *  __s, int __c, size_t __n)  ;

 
extern int memcmp  (__const void *  __s1, __const void *  __s2,
			size_t __n)  ;

 
extern void *  memchr  (__const void *  __s, int __c, size_t __n)  ;


 
extern char *strcpy  (char *   __dest,
			  __const char *   __src)  ;
 
extern char *strncpy  (char *   __dest,
			   __const char *   __src, size_t __n)  ;

 
extern char *strcat  (char *   __dest,
			  __const char *   __src)  ;
 
extern char *strncat  (char *   __dest,
			   __const char *   __src, size_t __n)  ;

 
extern int strcmp  (__const char *__s1, __const char *__s2)  ;
 
extern int strncmp  (__const char *__s1, __const char *__s2, size_t __n)  ;

 
extern int strcoll  (__const char *__s1, __const char *__s2)  ;
 
extern size_t strxfrm  (char *   __dest,
			    __const char *   __src, size_t __n)  ;

# 103 "/usr/include/string.h" 3 4



 
extern char *__strdup  (__const char *__s)  ;
extern char *strdup  (__const char *__s)  ;


 


extern char *__strndup  (__const char *__string, size_t __n)  ;




# 140 "/usr/include/string.h" 3 4


 
extern char *strchr  (__const char *__s, int __c)  ;
 
extern char *strrchr  (__const char *__s, int __c)  ;

 

extern size_t strcspn  (__const char *__s, __const char *__reject)  ;
 

extern size_t strspn  (__const char *__s, __const char *__accept)  ;
 
extern char *strpbrk  (__const char *__s, __const char *__accept)  ;
 
extern char *strstr  (__const char *__haystack, __const char *__needle)  ;









 
extern char *strtok  (char *   __s,
			  __const char *   __delim)  ;

 

extern char *__strtok_r  (char *__s, __const char *__delim,
			      char **__save_ptr)  ;

extern char *strtok_r  (char *__s, __const char *__delim,
			    char **__save_ptr)  ;


# 192 "/usr/include/string.h" 3 4



 
extern size_t strlen  (__const char *__s)  ;









 
extern char *strerror  (int __errnum)  ;

 

extern char *__strerror_r  (int __errnum, char *__buf, size_t __buflen)  ;
extern char *strerror_r  (int __errnum, char *__buf, size_t __buflen)  ;


 

extern void __bzero  (void *  __s, size_t __n)  ;


 
extern void bcopy  (__const void *  __src, void *  __dest, size_t __n)  ;

 
extern void bzero  (void *  __s, size_t __n)  ;

 
extern int bcmp  (__const void *  __s1, __const void *  __s2, size_t __n)  ;

 
extern char *index  (__const char *__s, int __c)  ;

 
extern char *rindex  (__const char *__s, int __c)  ;

 

extern int __ffs  (int __i)  ;
extern int ffs  (int __i)  ;

 
extern int __strcasecmp  (__const char *__s1, __const char *__s2)  ;
extern int strcasecmp  (__const char *__s1, __const char *__s2)  ;

 
extern int __strncasecmp  (__const char *__s1, __const char *__s2,
			       size_t __n)  ;
extern int strncasecmp  (__const char *__s1, __const char *__s2,
			     size_t __n)  ;


# 259 "/usr/include/string.h" 3 4



 

extern char *__strsep  (char **__stringp, __const char *__delim)  ;
extern char *strsep  (char **__stringp, __const char *__delim)  ;


# 298 "/usr/include/string.h" 3 4




# 326 "/usr/include/string.h" 3 4



} 


# 31 "/usr/lib/qt/include/qstring.h" 2







 



# 53 "/usr/lib/qt/include/qstring.h"



 



void *qmemmove( void *dst, const void *src, uint len );





char *qstrdup( const char * );

inline uint cstrlen( const char *str )
{ return strlen(str); }

inline uint qstrlen( const char *str )
{ return str ? strlen(str) : 0; }




inline char *cstrcpy( char *dst, const char *src )
{ return strcpy(dst,src); }

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 cstrcmp( const char *str1, const char *str2 )
{ return strcmp(str1,str2); }

inline int qstrcmp( const char *str1, const char *str2 )
{ return (str1 && str2) ? strcmp(str1,str2) : (int)((long)str2 - (long)str1); }




inline int cstrncmp( const char *str1, const char *str2, uint len )
{ return strncmp(str1,str2,len); }

inline int qstrncmp( const char *str1, const char *str2, uint len )
{ return (str1 && str2) ? strncmp(str1,str2,len) :
			  (int)((long)str2 - (long)str1); }




int qstricmp( const char *, const char * );
int qstrnicmp( const char *, const char *, uint len );







 



UINT16 qchecksum( const char *s, uint len );


Q_UINT16 qChecksum( const char *s, uint len );

 











 



QDataStream &operator<<( QDataStream &, const QArrayT<char>  & );
QDataStream &operator>>( QDataStream &, QArrayT<char>  & );


 



class QRegExp;

class QString : public QArrayT<char> 		 
{
public:
    QString() {}				 
    QString( int size );			 
    QString( const QString &s ) : QArrayT<char> ( s ) {}
    QString( const char *str );			 
    QString( const char *str, uint maxlen );	 

    QString    &operator=( const QString &s );	 
    QString    &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 );

    QString	copy()	const;

    QString    &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;

    QString	left( uint len )  const;
    QString	right( uint len ) const;
    QString	mid( uint index, uint len) const;

    QString	leftJustify( uint width, char fill=' ', bool trunc=FALSE)const;
    QString	rightJustify( uint width, char fill=' ',bool trunc=FALSE)const;

    QString	lower() const;
    QString	upper() const;

    QString	stripWhiteSpace()	const;
    QString	simplifyWhiteSpace()	const;

    QString    &insert( uint index, const char * );
    QString    &insert( uint index, char );
    QString    &append( const char * );
    QString    &prepend( const char * );
    QString    &remove( uint index, uint len );
    QString    &replace( uint index, uint len, const char * );
    QString    &replace( const QRegExp &, const 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;

    QString    &setStr( const char *s );
    QString    &setNum( short );
    QString    &setNum( ushort );
    QString    &setNum( int );
    QString    &setNum( uint );
    QString    &setNum( long );
    QString    &setNum( ulong );
    QString    &setNum( float, char f='g', int prec=6 );
    QString    &setNum( double, char f='g', int prec=6 );

    bool	setExpand( uint index, char c );

		operator const char *() const;
    QString    &operator+=( const char *str );
    QString    &operator+=( char c );
};


 



QDataStream &operator<<( QDataStream &, const QString & );
QDataStream &operator>>( QDataStream &, QString & );


 



inline QString &QString::operator=( const QString &s )
{ return (QString&)assign( s ); }

inline QString &QString::operator=( const char *str )
{ return (QString&)duplicate( str, qstrlen (str)+1 ); }

inline bool QString::isNull() const
{ return data() == 0; }

inline bool QString::isEmpty() const
{ return data() == 0 || *data() == '\0'; }

inline uint QString::length() const
{ return qstrlen ( data() ); }

inline bool QString::truncate( uint pos )
{ return resize(pos+1); }

inline QString QString::copy() const
{ return QString( data() ); }

inline QString &QString::prepend( const char *s )
{ return insert(0,s); }

inline QString &QString::append( const char *s )
{ return operator+=(s); }

inline QString &QString::setNum( short n )
{ return setNum((long)n); }

inline QString &QString::setNum( ushort n )
{ return setNum((ulong)n); }

inline QString &QString::setNum( int n )
{ return setNum((long)n); }

inline QString &QString::setNum( uint n )
{ return setNum((ulong)n); }

inline QString &QString::setNum( float n, char f, int prec )
{ return setNum((double)n,f,prec); }

inline QString::operator const char *() const
{ return (const char *)data(); }


 



inline bool operator==( const QString &s1, const QString &s2 )
{ return qstrcmp (s1.data(),s2.data()) == 0; }

inline bool operator==( const QString &s1, const char *s2 )
{ return qstrcmp (s1.data(),s2) == 0; }

inline bool operator==( const char *s1, const QString &s2 )
{ return qstrcmp (s1,s2.data()) == 0; }

inline bool operator!=( const QString &s1, const QString &s2 )
{ return qstrcmp (s1.data(),s2.data()) != 0; }

inline bool operator!=( const QString &s1, const char *s2 )
{ return qstrcmp (s1.data(),s2) != 0; }

inline bool operator!=( const char *s1, const QString &s2 )
{ return qstrcmp (s1,s2.data()) != 0; }

inline bool operator<( const QString &s1, const char *s2 )
{ return qstrcmp (s1.data(),s2) < 0; }

inline bool operator<( const char *s1, const QString &s2 )
{ return qstrcmp (s1,s2.data()) < 0; }

inline bool operator<=( const QString &s1, const char *s2 )
{ return qstrcmp (s1.data(),s2) <= 0; }

inline bool operator<=( const char *s1, const QString &s2 )
{ return qstrcmp (s1,s2.data()) <= 0; }

inline bool operator>( const QString &s1, const char *s2 )
{ return qstrcmp (s1.data(),s2) > 0; }

inline bool operator>( const char *s1, const QString &s2 )
{ return qstrcmp (s1,s2.data()) > 0; }

inline bool operator>=( const QString &s1, const char *s2 )
{ return qstrcmp (s1.data(),s2) >= 0; }

inline bool operator>=( const char *s1, const QString &s2 )
{ return qstrcmp (s1,s2.data()) >= 0; }

inline QString operator+( const QString &s1, const QString &s2 )
{
    QString tmp( s1.data() );
    tmp += s2;
    return tmp;
}

inline QString operator+( const QString &s1, const char *s2 )
{
    QString tmp( s1.data() );
    tmp += s2;
    return tmp;
}

inline QString operator+( const char *s1, const QString &s2 )
{
    QString tmp( s1 );
    tmp += s2;
    return tmp;
}

inline QString operator+( const QString &s1, char c2 )
{
    QString tmp( s1.data() );
    tmp += c2;
    return tmp;
}

inline QString operator+( char c1, const QString &s2 )
{
    QString tmp( c1 );
    tmp += s2;
    return tmp;
}



# 2 "qstring.cc" 2


int main( int argc, char ** argv )
{
   QString a( "stuff" );
   const char * b = a;
   printf( "->%s<-\n", b );
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]