[nagiosplug] Fix GCC's -Wimplicit-function-declaration warnings

Nagios Plugin Development nagios-plugins at users.sourceforge.net
Tue Sep 10 23:00:30 CEST 2013


 Module: nagiosplug
 Branch: master
 Commit: b48cb1f130cda9818d06aaf74cdc7d2aef13bf42
 Author: Holger Weiss <holger at zedat.fu-berlin.de>
   Date: Tue Sep 10 22:29:46 2013 +0200
    URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=b48cb1f

Fix GCC's -Wimplicit-function-declaration warnings

Fix the issues found by GCC when the -Wimplicit-function-declaration
flag is specified.

---

 lib/utils_base.c          |    3 +++
 plugins/check_ide_smart.c |   10 ++++++++--
 plugins/check_tcp.c       |    2 ++
 plugins/negate.c          |    3 +++
 plugins/runcmd.h          |   12 +-----------
 5 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/lib/utils_base.c b/lib/utils_base.c
index 8685e6f..54463e9 100644
--- a/lib/utils_base.c
+++ b/lib/utils_base.c
@@ -27,6 +27,7 @@
 #include "common.h"
 #include <stdarg.h>
 #include "utils_base.h"
+#include <ctype.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 
@@ -34,6 +35,8 @@
 
 nagios_plugin *this_nagios_plugin=NULL;
 
+int _np_state_read_file(FILE *);
+
 void np_init( char *plugin_name, int argc, char **argv ) {
 	if (this_nagios_plugin==NULL) {
 		this_nagios_plugin = calloc(1, sizeof(nagios_plugin));
diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c
index ee6bf7b..0a8009a 100644
--- a/plugins/check_ide_smart.c
+++ b/plugins/check_ide_smart.c
@@ -164,8 +164,14 @@ enum SmartCommand
 		SMART_CMD_AUTO_OFFLINE 
 	};
 
-void print_values (values_t * p, thresholds_t * t);
-int smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, char show_error); 
+char *get_offline_text (int);
+int smart_read_values (int, values_t *);
+int values_not_passed (values_t *, thresholds_t *);
+int nagios (values_t *, thresholds_t *);
+void print_value (value_t *, threshold_t *);
+void print_values (values_t *, thresholds_t *);
+int smart_cmd_simple (int, enum SmartCommand, __u8, char);
+int smart_read_thresholds (int, thresholds_t *);
 
 int
 main (int argc, char *argv[]) 
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index b024821..9e62638 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -32,6 +32,8 @@ char *progname;
 const char *copyright = "1999-2008";
 const char *email = "nagiosplug-devel at lists.sourceforge.net";
 
+#include <ctype.h>
+
 #include "common.h"
 #include "netutils.h"
 #include "utils.h"
diff --git a/plugins/negate.c b/plugins/negate.c
index 493988e..ef7d4e0 100644
--- a/plugins/negate.c
+++ b/plugins/negate.c
@@ -35,6 +35,8 @@ const char *email = "nagiosplug-devel at lists.sourceforge.net";
 
 #define DEFAULT_TIMEOUT 11
 
+#include <ctype.h>
+
 #include "common.h"
 #include "utils.h"
 #include "utils_cmd.h"
@@ -43,6 +45,7 @@ const char *email = "nagiosplug-devel at lists.sourceforge.net";
 
 static const char **process_arguments (int, char **);
 int validate_arguments (char **);
+int translate_state (char *);
 void print_help (void);
 void print_usage (void);
 int subst_text = FALSE;
diff --git a/plugins/runcmd.h b/plugins/runcmd.h
index 5957562..fe66067 100644
--- a/plugins/runcmd.h
+++ b/plugins/runcmd.h
@@ -25,17 +25,7 @@
 #define NAGIOSPLUG_RUNCMD_H
 
 #include "common.h"
-
-/** types **/
-struct output {
-	char *buf;     /* output buffer */
-	size_t buflen; /* output buffer content length */
-	char **line;   /* array of lines (points to buf) */
-	size_t *lens;  /* string lengths */
-	size_t lines;  /* lines of output */
-};
-
-typedef struct output output;
+#include "utils_cmd.h" /* for the "output" type */
 
 /** prototypes **/
 int np_runcmd(const char *, output *, output *, int);





More information about the Commits mailing list