Xref: utzoo comp.fonts:386 comp.sys.mac:22379 Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!uflorida!usfvax2!pollock From: pollock@usfvax2.EDU (Wayne Pollock) Newsgroups: comp.fonts,comp.sys.mac Subject: LightSpeed Pascal 1.11 bug Message-ID: <1151@usfvax2.EDU> Date: 29 Oct 88 05:02:24 GMT Reply-To: pollock@usfvax2.UUCP (Wayne Pollock) Organization: University of South Florida at Tampa Lines: 46 References: Below is a LSP program (re-pretty-printed to save screen space; why oh why can't I turn this option off?). The two copies are identical except for the keyword "packed" in the type statement. Was this ever a tough bug to find! (I thought I had an error in my program, which was over 1300 lines long.) PROGRAM mojo (output); TYPE y = RECORD a : integer; b : 0..2047 END; VAR x : y; BEGIN x.b := 255; writeln(x.b); x.b := 256; writeln(x.b); x.b := 257; writeln(x.b) END. (************************** GOOD RESULTS ***********************) 255 256 257 PROGRAM mojo (output); TYPE y = PACKED RECORD a : integer; b : 0..2047 END; VAR x : y; BEGIN x.b := 255; writeln(x.b); x.b := 256; writeln(x.b); x.b := 257; writeln(x.b) END. (************************** BAD RESULTS ***********************) 255 0 1 Anyone know a fix for this? It seems that by packing a subrange, LSP allocates only one byte for the range even if the size of the range is greater than 256! Wayne Pollock (The MAD Scientist) pollock@usfvax2.usf.edu Usenet: ...!{uflorida, codas}!usfvax2!pollock GEnie: W.POLLOCK