Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!hao!noao!mcdsun!rover!mph From: mph@rover.UUCP Newsgroups: comp.sys.amiga Subject: Function Typing in Lattice 3.10 was Re: AmigaDos DeleteFile() Message-ID: <445@rover.UUCP> Date: Fri, 31-Jul-87 12:27:46 EDT Article-I.D.: rover.445 Posted: Fri Jul 31 12:27:46 1987 Date-Received: Sun, 2-Aug-87 07:31:00 EDT References: <43STEVEG@MAINE> Reply-To: mph@rover.UUCP (Mark Huth) Organization: Motorola Microcomputer Division, Tempe, Az. Lines: 30 Summary: Need to work over the header files In article <43STEVEG@MAINE> JRH4373@TAMVENUS.BITNET writes: >return. Why then, does lattice issue a 'pointers to different objects' >warning when I declare a variable lock as 'struct FileLock *' and then >use it like this: 'lock = CreateDir()'? Is FileLock the right name? >Do I have to declare CreatDir() as an extern and specify it's type or what? > >Joel << Hatchet >> Hall >jrh4373@tamvenus > I use Lattice 3.10 extensively and am generally pleased. I also use Amiga-Lint from Gimpel (get version 2.00h - the original b version has a deadly pre- processor bug that generates a lot of extraneous error messages). I have dealt a great deal with typing problems (a hopeless Pascal Junkie), and think I can recommend a fix. Since CreateDir is undeclared, it is assumed to return type int, which is definitely not type struct FileLock * (which, if memory serves, is the correct type). What I have done is go through the Dos, Exec, etc header files and create correct function prototypes declared as external. Then when I include the header, the relevant function prototypes are also used. Some functions don't seem to have a logical header file, so I've also created a top-level include such as doslib.h, which declares the Meager Dog interfaces. While it is some work, both Lint and Lattice have been satisfied by this approach. Also, there are far fewer wierd and wonderful bugs in the code after Lint gets done. An alternative would be to write 'lock = (struct FileLock *) CreateDir(dirname)' but you have to do that every time! Mark Huth - I speak for myself seismo!noao!mcdsun!nud!rover!mph