Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!gatech!prism!gt4586c From: gt4586c@prism.gatech.EDU (WILLETT,THOMAS CARTER) Newsgroups: comp.sys.mac.programmer Subject: Picky Think Pascal compiler quirk - explanation sought Keywords: range checking and pointers Message-ID: <15829@hydra.gatech.EDU> Date: 25 Oct 90 04:05:50 GMT Organization: Georgia Institute of Technology Lines: 23 i discovered a strange little quirk in think pascal when the range checking option is enabled. one of the functions of the range checking is to flag nil pointer references. in my code i had something like type Xptr = ^extended; var X: Xptr; begin TheSize := SizeOf(X^); Now with range checking enabled, i get an error message during compile about a nil dereference. when i disable the range checking, it compiles fine, and the code runs just fine. is what i have done here sloppy programming and is that why the compiler barfs when range checking is enabled, or is it that the compiler doesn't understand that what i am doing is acceptable? any explanations would be appreciated. -- thomas willett Georgia Institute of Technology, Atlanta gt4586c@prism.gatech.edu "Violence is the last refuge of the incompetent." - Salvor Hardin (Foundation)