Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!bbn.com!nic!chaos.cs.brandeis.edu!chaos!phils From: phils@chaos.cs.brandeis.edu (Phil Shapiro) Newsgroups: comp.sys.mac.programmer Subject: Re: Think C, MacHeaders, and 'Require prototypes'? Message-ID: Date: 7 Jan 91 17:15:28 GMT References: <1991Jan4.212725.13050@eplrx7.uucp> Sender: phils@chaos.cs.brandeis.edu (Phil Shapiro) Organization: Symantec Corp. Lines: 34 In-Reply-To: leipold@eplrx7.uucp's message of 4 Jan 91 21:27:25 GMT In article <1991Jan4.212725.13050@eplrx7.uucp> leipold@eplrx7.uucp (Walt Leipold) writes: [...] I found some functions (e.g., GetItemMark, SetItemMark, ParamText, ...) whose arguments did not get coerced properly. Digging a little deeper, I found that these functions had no prototypes in *any* of the .h files in the "Mac #includes" folder. However, the compiler didn't complain about missing prototypes, so the precompiled MacHeaders must know something about these functions. Is MacHeaders more than the sum of its parts? Or is there some set of functions for which the compiler ignores the 'require prototypes' flag? THINK C has all (or almost all) of IM I-V built inside it. There's a resource (called 'TRAP') that contains the pertinent information about every Toolbox and OS Trap, including argument and return value size. Note that traps that require glue (OS and [Not in ROM]) are also in MacTraps. These routines are ignored by the "Require Prototypes" checker. This allows compilation to proceed much faster. If you want all of IM I-V prototyped, then you can ftp "MacProtos.h" from sumex-aim, and include that in your MacHeaders file. You may notice that some traps are prototyped in ThC's headers, this is only for traps that have non-integral (non 16 bit) return values. -phil -- Phil Shapiro Technical Support Analyst Language Products Group Symantec Corporation Internet: phils@chaos.cs.brandeis.edu -- Phil Shapiro Technical Support Analyst Language Products Group Symantec Corporation Internet: phils@chaos.cs.brandeis.edu