Previous: Variable Arguments Up: Portability Constraints Next: Language Differences

Data Types

Different machines have different ways of representing data. The VAX represents integers in a 2's complement format with the low-order byte first (``little endian''). Most Unix machines represent integers in a 2's complement format with the high-order byte first (``big endian''). In addition, most Unix machines use IEEE floating-point format, while the VAX uses its own floating-point format. The DECstation uses IEEE format with the bytes reversed.

All these data representation differences add up to major porting headaches. How does an application read a file that was written on a different machine? How does an application convert between data types? Fortunately, most data format conversions during I/O are handled automatically by the RTL. However, there are several areas to watch out for in application programs. See Section , Data Types and Host Representations, for details. The use of EQUIVALENCE statements in Fortran code for type conversion is a particular problem; see Section , No EQUIVALENCE for Type Conversion, for details.

rgd059@ipl.jpl.nasa.gov