#include // :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // Test program illustrating g++ problems with // ostream& << operator for long long on SGI // R. Ansari (LAL/IN2P3-CNRS) - April 2002 // # does not compile with g++ 3.0 // csh> g++ -o pbosll pbosll.cc // :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: typedef int int_4; typedef short int_2; typedef long long int_8; typedef unsigned long long uint_8; /* inline ostream & operator << (ostream& s, uint_8 x) { s << (unsigned long)x ; return(s); } */ main(int narg, char * arg[]) { cout << " sizeof uint_2 = " << sizeof(int_2) << " bytes" << endl; cout << " sizeof int_8 = " << sizeof(int_8) << " bytes" << endl; cout << " sizeof long = " << sizeof(long) << " bytes" << endl; cout << " sizeof long long = " << sizeof(long long) << " bytes" << endl; uint_8 uil = 657482392; cout << " uint_8 uil = 657482392 = ? " << uil << endl; uint_8 uil2 = 367165748239LL; cout << " uint_8 uil = 367165748239 = ? " << uil2 << endl; }