home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!mcsun!sunic!kth.se!dront.nada.kth.se!d88-jwa
- From: d88-jwa@dront.nada.kth.se (Jon W{tte)
- Subject: Re: Help! System error #28
- In-Reply-To: chuck@gte.com's message of 13 Aug 92 12:49:44 GMT
- Message-ID: <D88-JWA.92Aug13162902@dront.nada.kth.se>
- Followup-To: comp.sys.mac.programmer
- Originator: d88-jwa@dront.nada.kth.se
- Sender: usenet@kth.se (Usenet)
- Nntp-Posting-Host: dront.nada.kth.se
- Organization: Royal Institute of Technology, Stockholm, Sweden
- References: <chuck-120892123052@choffman.gte.com> <chuck-130892084411@choffman.gte.com>
- Date: Thu, 13 Aug 1992 15:29:02 GMT
- Lines: 42
-
- > chuck@gte.com (Chuck Hoffman) writes:
-
- The problem turned out to be a dumb error masquerading as a memory
- management problem, though. I had passed an int to FSRead for the number
- of bytes to read. It was expecting a long, so FSRead thought the few bytes
-
- This kind of problem would have been much easier to debug at the assembly
- level with MacsBug, rather than at the source level with THINK C Debugger.
- I'm a very experienced programmer using IBM System/370 Assembly Language
-
- It would be even easier to avoid by having the compiler catch
- the error.
-
- If you use MPW, turn on all warnings. If you use Think C,
- follow these simple steps:
-
- 1) Turn on "prototype enforcement" and "require prototypes"
- in the language settings
- 2) Turn on "Check pointer types" in the same dialog.
- Be sure to copy options to new projects as well at this point.
- 3) Open your "Mac #Includes.c" file in the MacIncludes folder
- 4) Change #define SIMPLIFY_PROTOTYPES to 0
- 5) While you're at it, turn on ALL of the header files,
- except for the few mentioned in the comment at the start
- of the file.
- 6) Choose "Precompile"
- 7) Save as MacHeaders, overwriting your previous MacHeaders.
-
- This trick will not only catch a LOT of otherwise hard to find bugs,
- including the bug you just described, but it will reduce the size of
- your project file a lot. If you use the class library, why not include
- those headers as well ? A class library project then becomes < 600K in
- size !
-
- If you don't do this, you're just stupid and ignorant and deserve to
- be bitten by all the bugs that find you :-)
-
- --
- - I have decided that it is not boxes but my lack of skill that's the problem.
- - Traitor! This kind of attitude will get you nowhere around here. If you must
- know, it's not your boxes that are the problem, it's your lack of a
- sufficient number of boxes. Go out and buy something.
-