Mail Archives: djgpp/1995/10/11/17:01:30
On Wed, 11 Oct 1995 16:03:43 GMT, kagel AT quasar DOT bloomberg DOT com
<kagel AT quasar DOT bloomberg DOT com> wrote:
: -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.
I would like to see this extended to variable declarations as well. Let me
be more specific. Consider two files: header.h amd file.c:
/* header.h */
extern int function_one (void);
extern int Variable_One;
/* file.c */
#include "header.h"
int Variable_One;
static int Variable_Two;
int function_one (void) { ... }
int function_two (void) { ... }
static int function_three (void) {...}
Now, if compiled with -Wmissing-prototypes, a warning is generated for
function_two saying that a previous prototype does not exist. However,
since function_three is static, no warning is generated. This means that
one can use -Wmissing-prototypes to see which functions should be made
static. I would like to have the ability to do this for variables as well.
That is, I would like to see a warning for Variable_One but not for
Variable_Two.
Comments?
--John
- Raw text -