INF: Far Pointer Comparisons Assume Same Segment

ID Number: Q34408

5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a

MS-DOS | OS/2

Summary:

In Microsoft C versions 5.1, 6.0, 6.0a, 6.0ax, and C/C++ version 7.0,

when comparing far pointers with the <, >, <=, or >= operators, the

two pointers must be in the same segment. The equality operator (==)

tests both segment and offset to prevent two pointers that have the

same offset, but different segments, from being considered equal.

The <, >, <=, and >= operators assume that the pointers share the same

segment because according to ANSI, pointers can only be compared for

precedence if they point to the same object. In a segmented

architecture such as Intel's, two pointers to the same object must

share the same segment value, unless the pointers are declared to

point to a huge object, in which case the pointers are handled using

32-bit arithmetic.

Additional reference words: 5.00 5.10 6.00 6.00a 6.00ax 7.00