svn commit: r320033 - head/contrib/tcp_wrappers
Sean Bruno
sbruno at FreeBSD.org
Fri Jun 16 22:32:25 UTC 2017
Author: sbruno
Date: Fri Jun 16 22:32:23 2017
New Revision: 320033
URL: https://svnweb.freebsd.org/changeset/base/320033
Log:
TCP Wrappers: tcpdchk (tcp wrapper configuration checker) and tcpdmatch
(tcp wrapper oracle) warning fixes via edits to the C code files
contrib/tcp_wrappers/fakelog.c
Warnings for each of functions: openlog( ), vsyslog( ), VARARGS( ),
closelog( )
warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
warning: control reaches end of non-void function [-Wreturn-type]
Fixes:
Explicitly added specification of function type to void for each
function, suppressing both warnings for each function listed
contrib/tcp_wrappers/inetcf.c
Warnings:
warning: incompativle redeclaration of library function 'malloc'
note: 'malloc' is a builtin with type 'void *(unsigned long)'
warning: implicit declaration of function 'check_path' is invalid in C99
[-Wimplicit-function-declaration]
Fixes:
Removed redeclaration of malloc on line 21
Included library <stdlib.h> in the code which contains the malloc( )
function in it's library
Included scaffold.h header file in the code that contains check-path( )
function
contrib/tcp_wrappers/scaffold.c
Warnings:
warning: implicitly declaring library function 'exit' with type
'void (int) __attribute__((noreturn))' [-Wimplicit-function-declaration]
note: include the header <stdlib.h> or explicitly provide a declaration
for 'exit'
Fixes:
Included <stdlib.h> in the code which contains the exit( ) function in
it's library
contrib/tcp_wrappers/tcpdchk.c
Warnings:
warning: implicit declaration of function 'getopt' is invalid
in C99 [-Wimplicit-function-declaration]
warning: implicit declaration of function 'atoi' is invalid
in C99 [-Wimplicit-function-declaration]
Fixes:
Included the specific function <getopt.h> library to the code
Included<stdlib.h> to the code which contains the atoi( ) function in
the library
contrib/tcp_wrappers/tcpdmatch.c
Warnings:
warning: implicit declaration of function 'getopt' is invalid in C99
[-Wimplicit-function-declaration]
Fixes:
Included<stdlib.h> to the code which contains the getopt( ) function in
the library
Submitted by: Aaron Prieger <aprieger at llnw.com>
Reviewed by: vangyzen
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D10995
Modified:
head/contrib/tcp_wrappers/fakelog.c
head/contrib/tcp_wrappers/inetcf.c
head/contrib/tcp_wrappers/scaffold.c
head/contrib/tcp_wrappers/tcpdchk.c
head/contrib/tcp_wrappers/tcpdmatch.c
Modified: head/contrib/tcp_wrappers/fakelog.c
==============================================================================
--- head/contrib/tcp_wrappers/fakelog.c Fri Jun 16 22:07:14 2017 (r320032)
+++ head/contrib/tcp_wrappers/fakelog.c Fri Jun 16 22:32:23 2017 (r320033)
@@ -17,7 +17,7 @@ static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17
/* ARGSUSED */
-openlog(name, logopt, facility)
+void openlog(name, logopt, facility)
char *name;
int logopt;
int facility;
@@ -27,7 +27,7 @@ int facility;
/* vsyslog - format one record */
-vsyslog(severity, fmt, ap)
+void vsyslog(severity, fmt, ap)
int severity;
char *fmt;
va_list ap;
@@ -43,7 +43,7 @@ va_list ap;
/* VARARGS */
-VARARGS(syslog, int, severity)
+void VARARGS(syslog, int, severity)
{
va_list ap;
char *fmt;
@@ -56,7 +56,7 @@ VARARGS(syslog, int, severity)
/* closelog - dummy */
-closelog()
+void closelog()
{
/* void */
}
Modified: head/contrib/tcp_wrappers/inetcf.c
==============================================================================
--- head/contrib/tcp_wrappers/inetcf.c Fri Jun 16 22:07:14 2017 (r320032)
+++ head/contrib/tcp_wrappers/inetcf.c Fri Jun 16 22:32:23 2017 (r320033)
@@ -15,13 +15,14 @@ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:
#include <stdio.h>
#include <errno.h>
#include <string.h>
+#include <stdlib.h>
extern int errno;
extern void exit();
-extern char *malloc();
#include "tcpd.h"
#include "inetcf.h"
+#include "scaffold.h"
/*
* Network configuration files may live in unusual places. Here are some
Modified: head/contrib/tcp_wrappers/scaffold.c
==============================================================================
--- head/contrib/tcp_wrappers/scaffold.c Fri Jun 16 22:07:14 2017 (r320032)
+++ head/contrib/tcp_wrappers/scaffold.c Fri Jun 16 22:32:23 2017 (r320033)
@@ -22,6 +22,7 @@ static char sccs_id[] = "@(#) scaffold.c 1.6 97/03/21
#include <syslog.h>
#include <setjmp.h>
#include <string.h>
+#include <stdlib.h>
#ifndef INADDR_NONE
#define INADDR_NONE (-1) /* XXX should be 0xffffffff */
Modified: head/contrib/tcp_wrappers/tcpdchk.c
==============================================================================
--- head/contrib/tcp_wrappers/tcpdchk.c Fri Jun 16 22:07:14 2017 (r320032)
+++ head/contrib/tcp_wrappers/tcpdchk.c Fri Jun 16 22:32:23 2017 (r320033)
@@ -35,6 +35,8 @@ static char sccsid[] = "@(#) tcpdchk.c 1.8 97/02/12 02
#include <errno.h>
#include <netdb.h>
#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int errno;
extern void exit();
Modified: head/contrib/tcp_wrappers/tcpdmatch.c
==============================================================================
--- head/contrib/tcp_wrappers/tcpdmatch.c Fri Jun 16 22:07:14 2017 (r320032)
+++ head/contrib/tcp_wrappers/tcpdmatch.c Fri Jun 16 22:32:23 2017 (r320033)
@@ -31,6 +31,7 @@ static char sccsid[] = "@(#) tcpdmatch.c 1.5 96/02/11
#include <syslog.h>
#include <setjmp.h>
#include <string.h>
+#include <unistd.h>
extern void exit();
extern int optind;
More information about the svn-src-all
mailing list