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@llnw.com>
Reviewed by:	vangyzen
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D10995
This commit is contained in:
Sean Bruno 2017-06-16 22:32:23 +00:00
parent 7970b89399
commit 74812c2ba4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320033
5 changed files with 10 additions and 5 deletions

View file

@ -17,7 +17,7 @@ static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17:42:21";
/* 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 */
}

View file

@ -15,13 +15,14 @@ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:13:23";
#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

View file

@ -22,6 +22,7 @@ static char sccs_id[] = "@(#) scaffold.c 1.6 97/03/21 19:27:24";
#include <syslog.h>
#include <setjmp.h>
#include <string.h>
#include <stdlib.h>
#ifndef INADDR_NONE
#define INADDR_NONE (-1) /* XXX should be 0xffffffff */

View file

@ -35,6 +35,8 @@ static char sccsid[] = "@(#) tcpdchk.c 1.8 97/02/12 02:13:25";
#include <errno.h>
#include <netdb.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
extern int errno;
extern void exit();

View file

@ -31,6 +31,7 @@ static char sccsid[] = "@(#) tcpdmatch.c 1.5 96/02/11 17:01:36";
#include <syslog.h>
#include <setjmp.h>
#include <string.h>
#include <unistd.h>
extern void exit();
extern int optind;