function declarations

Steve Harrold swh at hpsmtc1.HP.COM
Thu Dec 8 01:23:15 AEST 1988


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.

2) If you use <varargs.h> in your parameter list, the function prototype that
   is generated names a type "va_alist", rather than inserting the "..." string
   that ANSI uses to denote optional (varargs) parameters.  Again, the
   compiler complains about the mismatch (usually "too many parameters").

Still, it's better than nothing.
--
---------------------
Steve Harrold			...hplabs!hpsmtc1!swh
				HPG200/13
				(408) 447-5580
---------------------



More information about the Comp.lang.c mailing list