Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!agate!garnet.berkeley.edu!physi-hf From: physi-hf@garnet.berkeley.edu (Howard Haruo Fukuda) Newsgroups: comp.sys.mac.programmer Subject: Re: Think C Problem Keywords: DA Message-ID: <1990Nov18.070105.20735@agate.berkeley.edu> Date: 18 Nov 90 07:01:05 GMT References: <1990Oct27.074058.10748@agate.berkeley.edu> <4742@husc6.harvard.edu> Sender: usenet@agate.berkeley.edu (USENET Administrator) Distribution: usa Organization: University of California, Berkeley Lines: 29 In article <4742@husc6.harvard.edu> siegel@endor.UUCP (Rich Siegel) writes: >In article <1990Oct27.074058.10748@agate.berkeley.edu> physi-hf@garnet.berkeley.edu (Howard Haruo Fukuda) writes: > >>Poking around with Macsbug, I've found out that, Think C has put some of my >>global variables for a DA at an odd numbered address. It then tries to copy > >>I guess as a last resort, I could rewrite it for MPW C, but I would like to >>hear any more elegant solutions, especially since MPW C doesn't support global >>variables in a DA like Think C does. > > Last Resorts aren't necessary here. Instead, take care that all of >your strings are aligned on word boundaries. I'm not 100% sure, but I believe >that this will ameliorate the problem. I'm not sure I understand your response. My problem was that Think C was not putting my strings on word boundaries. The line: Str255="\pHuh???"; places the pascal string at an odd-numbered address (well, not neccessarily all the time). For some reason changing the line to: static Str255="\pHuh???"; does put the string on a word boundary. (Thanks to Steve Martin for telling about the above hack.) Why does this work? -Howard