Path: utzoo!attcan!uunet!lll-winken!tekbspa!optilink!cramer From: cramer@optilink.UUCP (Clayton Cramer) Newsgroups: comp.lang.c Subject: Re: function declarations Message-ID: <711@optilink.UUCP> Date: 9 Dec 88 19:44:39 GMT References: <661@infmx.UUCP. <11480014@hpsmtc1.HP.COM. Organization: Optilink Corporation, Petaluma, CA Lines: 30 In article <11480014@hpsmtc1.HP.COM., swh@hpsmtc1.HP.COM (Steve Harrold) writes: . Re: Function prototypes . . The MSC /Zg switch is useful, but doesn't do everything. For example, . . 1) All parameters that are structs or pointer to structs get translated to . "struct UNNAMED". If you then use these function prototypes in your code, . you will get compile-time messages announcing a type mismatch between the . the non-existent "struct UNNAMED" and whatever struct is actually in your . code. For MSC, this is a warning, and the compilation succeeds. For . Turbo C, this is an error, and compilation fails. For older (non-ANSI) . compilers, there is no message. Easy solution: always create a structure tag when you do a typedef. I'm amazed how many people don't realize that struct and enum optionally accept a tag. Use the tag, and the /Zg switch will produce useful prototypes. . 2) If you use