home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20529 < prev    next >
Encoding:
Internet Message Format  |  1993-01-02  |  2.1 KB

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