This is the mail archive of the gcc@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]

long long and __extension__ on hpux


Hi,

I have problems using 'long long' on hpux10.20, gcc2.95.2

The code I try to compile declares an outputoperator for 'long long'
and 'unsigned long long'. The error I get is this: 

/opt/gcc/bin/gcc -I . -c ../source/basicTypes.C
../source/basicTypes.C: In function `class ostream & operator
<<(ostream &, long long int)':
../source/basicTypes.C:70: ambiguous overload for `ostream & <<
uint64'
/opt/gcc/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/../../../../include/g
++-3/iostream.h:77: candidates are: class ostream & ostream::operator
<<(char)
/opt/gcc/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/../../../../include/g
++-3/iostream.h:78:                 class ostream & ostream::operator
<<(unsigned char)
/opt/gcc/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/../../../../include/g
++-3/iostream.h:79:                 class ostream & ostream::operator
<<(signed char)  and so on, continuing for other integer types  

It seems to me that the compiler is unable to pick up the correct
ostream operator, but I can't understad why. It is declared in
iostream.h like this:

#if defined(__GNUC__)
    __extension__ ostream& operator<<(long long n);
    __extension__ ostream& operator<<(unsigned long long n);
#endif

What does __extension__ mean? Do I have to turn on some compilator-flag to
get the 'long long' and 'unsigned long long' functions to work? Or is the
problem something else. Solutions or explanations anyone?

Thanks in advance.
--Arne Sorli--



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