[Nagiosplug-devel] Re: -Wall clean patch

Edward J. Sabol sabol at alderaan.gsfc.nasa.gov
Thu Jun 2 06:55:08 CEST 2005

> The attached patch makes the plugins compile cleanly on FC3 and 
> Owl-current with -Wall applied. No logic has been changed, so I haven't 
> tested it any more than a re-compile.
> diff -urN ../orig.nplg/plugins/check_nagios.c ./plugins/check_nagios.c
> --- ../orig.nplg/plugins/check_nagios.c	2005-05-26 14:12:21.000000000 +0200
> +++ ./plugins/check_nagios.c	2005-06-01 07:28:00.000000000 +0200
> @@ -55,7 +55,6 @@
>  	int procrss = 0;
>  	float procpcpu = 0;
>  	char procstat[8];
> -	char procetime[MAX_INPUT_BUFFER];
>  	char procprog[MAX_INPUT_BUFFER];
>  	char *procargs;
>  	int pos, cols;

Um, you need to keep procetime there, don't you? It may or may not be in
PS_VARLIST, depending upon what configure does. If it is in PS_VARLIST, then
the check_nagios.c plugin will no longer compile, unless I'm misunderstanding

Otherwise, this looks very good.

> How portable is -Wall btw? Perhaps it should always be turned on when 
> available?

The Apache httpd_apreq developers added a configure switch for developers to
use to turn on -Wall. Actually, it turns on a bunch of gcc warnings. Here's
the list they use:

-Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations \
-Wwrite-strings -Wcast-qual -Wfloat-equal -Wshadow -Wpointer-arith \
-Wbad-function-cast -Wsign-compare -Waggregate-return -Wmissing-noreturn \
-Wmissing-format-attribute -Wpacked -Wredundant-decls -Wnested-externs \
-Wdisabled-optimization -Wno-long-long -Wendif-labels -Wcast-align

More information about the Devel mailing list