Date: Wed, 11 Oct 1995 12:03:43 -0400 From: kagel AT quasar DOT bloomberg DOT com To: library AT ssd DOT anet DOT cz Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Prototype Checking Reply-To: kagel AT ts1 DOT bloomberg DOT com Date: Sat, 7 Oct 1995 12:30:13 +0100 (MET) From: "Nathan L. Cutler" I am going through a C tutorial that is very good but quite old. One of the things it is telling me to do is to enable prototype checking with my compiler. I am using djgpp. (1) is it actually necessary to turn on proto- type checking with gcc? and (2) what is the command-line extension to do so? Gcc does do basic prototype checking, however there are options to add stricter checking: -Wconversion Warn if a prototype causes a type conversion that is different from what would happen to the same argument in the absence of a prototype. This includes conversions of fixed point to floating and vice versa, and conversions changing the width or signedness of a fixed point argument except when the same as the default promotion. -Waggregate-return Warn if any functions that return structures or unions are defined or called. -Wstrict-prototypes Warn if a function is declared or defined without specifying the argument types. (An old-style function definition is permitted without a warning if preceded by a declaration which specifies the argument types.) -Wmissing-prototypes Warn if a global function is defined without a previous prototype declaration. This warning is issued even if the definition itself provides a prototype. The aim is to detect global functions that fail to be declared in header files. -Wredundant-decls Warn if anything is declared more than once in the same scope, even in cases where multiple declaration is valid and changes nothing. -Wnested-externs Warn if an extern declaration is encountered within a function. -mwarn-passed-structs Emit a warning message if a structure is passed to a function, or declared as a function argument. This warns about the places where gcc will not interoperate with compilers that do not pass structures according to the 88open Object Compatibility Standard. -- Art S. Kagel, kagel AT ts1 DOT bloomberg DOT com Variety is the soul of pleasure. -- Aphra Behn