| 
            Last change
 on this file since 3481 was             1966, checked in by ansari, 24 years ago           | 
        
        
          | 
             
Ajout programmes test de pb de compilation g++ 2.95/3.01 - Reza 25/4/2002 
 
           | 
        
        
          | 
            File size:
            1.0 KB
           | 
        
      
      
| Line |   | 
|---|
| 1 | #include <iostream.h>
 | 
|---|
| 2 | 
 | 
|---|
| 3 | // ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 | 
|---|
| 4 | // Test program illustrating g++ problems with 
 | 
|---|
| 5 | // ostream& << operator for long long on SGI 
 | 
|---|
| 6 | //         R. Ansari (LAL/IN2P3-CNRS) - April 2002
 | 
|---|
| 7 | // # does not compile with g++ 3.0
 | 
|---|
| 8 | // csh> g++ -o pbosll pbosll.cc
 | 
|---|
| 9 | // ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 | 
|---|
| 10 | 
 | 
|---|
| 11 |   typedef int int_4;
 | 
|---|
| 12 |   typedef short int_2;
 | 
|---|
| 13 |   typedef long long int_8;
 | 
|---|
| 14 |   typedef unsigned long long uint_8;
 | 
|---|
| 15 | 
 | 
|---|
| 16 | /* 
 | 
|---|
| 17 | inline ostream & operator << (ostream& s, uint_8 x) 
 | 
|---|
| 18 | { s << (unsigned long)x ; return(s); }
 | 
|---|
| 19 | */
 | 
|---|
| 20 | 
 | 
|---|
| 21 | main(int narg, char * arg[])
 | 
|---|
| 22 | {
 | 
|---|
| 23 | 
 | 
|---|
| 24 |   cout << " sizeof uint_2 = " << sizeof(int_2) << " bytes" << endl;
 | 
|---|
| 25 |   cout << " sizeof int_8 = " << sizeof(int_8) << " bytes" << endl;
 | 
|---|
| 26 |   cout << " sizeof long = " << sizeof(long) << " bytes" << endl;
 | 
|---|
| 27 |   cout << " sizeof long long = " << sizeof(long long) << " bytes" << endl;
 | 
|---|
| 28 | 
 | 
|---|
| 29 |   uint_8 uil = 657482392;
 | 
|---|
| 30 |   cout << "  uint_8 uil = 657482392 = ? " << uil << endl;
 | 
|---|
| 31 |   uint_8 uil2 = 367165748239LL;
 | 
|---|
| 32 |   cout << "  uint_8 uil = 367165748239 = ? " << uil2 << endl;
 | 
|---|
| 33 |   
 | 
|---|
| 34 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.