home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!bnr.co.uk!uknet!edcastle!ngse18
- From: ngse18@castle.ed.ac.uk (J R Evans)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Sozobon C - a free C for the Mac, too? [Correction]
- Message-ID: <29870@castle.ed.ac.uk>
- Date: 2 Jan 93 11:12:59 GMT
- References: <29848@castle.ed.ac.uk>,<3917@isgtec.isgtec.com> <1992Dec31.134136.24364@alw.nih.gov>
- Organization: Edinburgh University
- Lines: 34
-
- In article <29848@castle.ed.ac.uk> ngse18@castle.ed.ac.uk (J R Evans) wrote:
-
- >The few initial problems I had were
- >connected with Sozobon's assumption that sizeof(int)=4, whereas Think C
- >uses sizeof(int)=2, and Think C's little gotcha that sizeof(size_t) !=
- >sizeof(integer constant).
-
- I've had several mail messages correctly querying this statement. My
- brain must have been out to lunch when I wrote it, because all publicly
- available versions of Sozobon use sizeof(int)=2 [and sizeof(size_t)=2,
- also]. The first (minor) problem I had was in no way connected with
- sizeof(int), but rather with padding of bitfields. The second was that
- the author of Sozobon (Johann Ruegg) had written a small integer constant
- in contexts where a size_t was called for. The small integer constant
- is implicitly converted to (int), and whereas sizeof(int)=sizeof(size_t)
- within Sozobon (and presumably other compilers that have hosted it),
- this is not so within Think C version 4, which I am using. I guess that
- a strict ANSI C would have noticed the type mismatch, but Think C 4 missed
- it, with horrible results when the small integer constant is the counter
- argument to strncpy!
-
- Think C 5 apparently has a switch to allow 4 byte integers.
- [Why don't I upgrade? -- because it would cost me 3x what I paid
- for the original compiler, due to US/UK pricing differentials]
-
- For the record, I was working with the source for version 2.0 of Sozobon;
- The source for Ian Lepore's divergent line (1.33) is not currently
- available to me, but Chris Herborth <cherborth@ca.on.waterloo.tdkcs.semprini>
- reports that release of his latest version -- 1.40, to include full sources
- -- is imminent.
-
- Thanks to all who took the trouble to write on this.
-
- Russ
-