Kaynağa Gözat

Fix implicit function declarations, strict prototypes (should resolve #670)

Sebastian Wolf 3 yıl önce
ebeveyn
işleme
8017ddc444
5 değiştirilmiş dosya ile 7 ekleme ve 4 silme
  1. 1 0
      NEWS
  2. 2 2
      lib/utils_base.h
  3. 1 1
      plugins/check_load.c
  4. 1 1
      plugins/netutils.h
  5. 2 0
      plugins/utils.h

+ 1 - 0
NEWS

@@ -5,6 +5,7 @@ This file documents the major additions and syntax changes between releases.
 	check_ntp_time: Ensure -W/-C (stratum warning/critical thresholds) are available as short options (#661)
 	check_icmp: Fix "Invalid Argument" errors on FreeBSD 13.1 (#659)
 	check_icmp: Fix address binding in ipv6 (#666)
+	Fixed several compile errors for upcoming clang-16
 
 2.4.0 2021-11-18
 	ENHANCEMENTS

+ 2 - 2
lib/utils_base.h

@@ -103,12 +103,12 @@ char *np_extract_value(const char*, const char*, char);
 
 
 void np_enable_state(char *, int);
-state_data *np_state_read();
+state_data *np_state_read(void);
 void np_state_write_string(time_t, char *);
 
 void np_init(char *, int argc, char **argv);
 void np_set_args(int argc, char **argv);
-void np_cleanup();
+void np_cleanup(void);
 
 /* np_suid() returns true if the real and effective uids differs, such as when
  * running a suid plugin */

+ 1 - 1
plugins/check_load.c

@@ -53,7 +53,7 @@ static int process_arguments (int argc, char **argv);
 static int validate_arguments (void);
 void print_help (void);
 void print_usage (void);
-static int print_top_consuming_processes();
+static int print_top_consuming_processes(void);
 
 static int n_procs_to_show = 0;
 

+ 1 - 1
plugins/netutils.h

@@ -108,7 +108,7 @@ int np_net_ssl_init(int sd);
 int np_net_ssl_init_with_hostname(int sd, char *host_name);
 int np_net_ssl_init_with_hostname_and_version(int sd, char *host_name, int version);
 int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int version, char *cert, char *privkey);
-void np_net_ssl_cleanup();
+void np_net_ssl_cleanup(void);
 int np_net_ssl_write(const void *buf, int num);
 int np_net_ssl_read(void *buf, int num);
 int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit);

+ 2 - 0
plugins/utils.h

@@ -79,6 +79,8 @@ char *strpcat (char *, const char *, const char *);
 int xvasprintf (char **strp, const char *fmt, va_list ap);
 int xasprintf (char **strp, const char *fmt, ...);
 
+
+int min_state (int a, int b);
 int max_state (int a, int b);
 int max_state_alt (int a, int b);