Pointer Comparison and Portability

john at viper.UUCP john at viper.UUCP
Sun Feb 22 07:02:46 AEST 1987


Both Tom Stockfisch and Dale Worley make a good point.  The method I used
to construct the problem pointers is certanly illegal in standard C.
  My response was primarily to the people talking about how the function
in question to compare two pointers could fail on a 80x86 arcitecture
machine.  I guess I should have made the orientation of my answer a bit
more clear.  Since some pointers used by programs in an MS-DOS environment 
are created by the operating system and not from C it is possible to have
illegally constructed pointers.
  The original question from Neil Webber asked if the function would
return TRUE if the two pointers pointed to the same "physical" character...
The side-track of 80x86 pointers carried this a bit beyond questions limited
only to "standard" C and I guess the failure cases will only occur when a
programmer goes a bit beyond what is legal, (and I'm sure -none- of us would
-ever- do anything in C that wasn't by-the-book...  ;-)
--- 
John Stanley (john at viper.UUCP)
Software Consultant - DynaSoft Systems
UUCP: ...{amdahl,ihnp4,rutgers}!{meccts,dayton}!viper!john



More information about the Comp.lang.c mailing list