Queisce two category of clang warnings:

1.  missing explicit includes for string.h, stdio.h, etc
2.  missing explicit declaration for some common functions

I have been unable to contact the upstream maintainer for this patch,
http://www.inner.net/opie appears to be the source of truth but it
unreachable
This commit is contained in:
Sean Bruno 2013-10-28 18:24:31 +00:00
parent b51b786d73
commit 2f1e5d4767
12 changed files with 23 additions and 0 deletions

View File

@ -28,6 +28,7 @@ License Agreement applies to this software.
#include "opie_cfg.h" #include "opie_cfg.h"
#include <stdio.h> #include <stdio.h>
#include <ctype.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@ -49,6 +49,7 @@ $FreeBSD$
#if DEBUG #if DEBUG
#include <syslog.h> #include <syslog.h>
#endif /* DEBUG */ #endif /* DEBUG */
#include <stdio.h>
#include "opie.h" #include "opie.h"
static char *algids[] = { NULL, NULL, NULL, "sha1", "md4", "md5" }; static char *algids[] = { NULL, NULL, NULL, "sha1", "md4", "md5" };

View File

@ -13,6 +13,7 @@ you didn't get a copy, you may request one from <license@inner.net>.
#include "opie_cfg.h" #include "opie_cfg.h"
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "opie.h" #include "opie.h"
int opielookup FUNCTION((opie, principal), struct opie *opie AND char *principal) int opielookup FUNCTION((opie, principal), struct opie *opie AND char *principal)

View File

@ -18,6 +18,9 @@ $FreeBSD$
*/ */
#include "opie_cfg.h" #include "opie_cfg.h"
#ifndef HAVE_TIME_H
#define HAVE_TIME_H 1
#endif
#if HAVE_TIME_H #if HAVE_TIME_H
#include <time.h> #include <time.h>
#endif /* HAVE_TIME_H */ #endif /* HAVE_TIME_H */
@ -35,6 +38,8 @@ $FreeBSD$
#if DEBUG #if DEBUG
#include <syslog.h> #include <syslog.h>
#endif /* DEBUG */ #endif /* DEBUG */
#include <stdio.h>
#include <stdlib.h>
#include "opie.h" #include "opie.h"
int opienewseed FUNCTION((seed), char *seed) int opienewseed FUNCTION((seed), char *seed)

View File

@ -19,6 +19,8 @@ you didn't get a copy, you may request one from <license@inner.net>.
#if HAVE_STRING_H #if HAVE_STRING_H
#include <string.h> #include <string.h>
#endif /* HAVE_STRING_H */ #endif /* HAVE_STRING_H */
#include <ctype.h>
#include <stdlib.h>
#include "opie.h" #include "opie.h"
struct algorithm { struct algorithm {

View File

@ -20,6 +20,7 @@ you didn't get a copy, you may request one from <license@inner.net>.
Created by cmetz for OPIE 2.22. Created by cmetz for OPIE 2.22.
*/ */
#include <string.h>
#include "opie_cfg.h" #include "opie_cfg.h"
#include "opie.h" #include "opie.h"

View File

@ -26,6 +26,9 @@ License Agreement applies to this software.
Created at NRL for OPIE 2.2 from opiesubr2.c Created at NRL for OPIE 2.2 from opiesubr2.c
*/ */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "opie_cfg.h" #include "opie_cfg.h"
#include "opie.h" #include "opie.h"

View File

@ -24,6 +24,7 @@ you didn't get a copy, you may request one from <license@inner.net>.
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
#include <string.h> #include <string.h>
#endif /* HAVE_STRING_H */ #endif /* HAVE_STRING_H */
#include <ctype.h>
#include "opie.h" #include "opie.h"
#define RESPONSE_STANDARD 0 #define RESPONSE_STANDARD 0

View File

@ -17,6 +17,8 @@ License Agreement applies to this software.
Modified by cmetz for OPIE 2.2. Use FUNCTION declaration et al. Modified by cmetz for OPIE 2.2. Use FUNCTION declaration et al.
Created at NRL for OPIE 2.2 from opiesubr.c. Created at NRL for OPIE 2.2 from opiesubr.c.
*/ */
#include <stdio.h>
#include <stdlib.h>
#include "opie_cfg.h" #include "opie_cfg.h"
#include "opie.h" #include "opie.h"

View File

@ -128,6 +128,7 @@ void opieunlockaeh __P((void));
void opiedisableaeh __P((void)); void opiedisableaeh __P((void));
int opielookup __P((struct opie *,char *)); int opielookup __P((struct opie *,char *));
int opiepasscheck __P((char *)); int opiepasscheck __P((char *));
int opienewseed __P((char *));
void opierandomchallenge __P((char *)); void opierandomchallenge __P((char *));
char * opieskipspace __P((register char *)); char * opieskipspace __P((register char *));
void opiestripcrlf __P((char *)); void opiestripcrlf __P((char *));
@ -139,6 +140,8 @@ const char *opie_get_algorithm __P((void));
int opie_haskey __P((char *username)); int opie_haskey __P((char *username));
char *opie_keyinfo __P((char *)); char *opie_keyinfo __P((char *));
int opie_passverify __P((char *username, char *passwd)); int opie_passverify __P((char *username, char *passwd));
int opieinsecure __P((void));
void opieversion __P((void));
__END_DECLS __END_DECLS
#if _OPIE #if _OPIE
@ -158,6 +161,7 @@ FILE *__opieopen __P((char *, int, int));
int __opiereadrec __P((struct opie *)); int __opiereadrec __P((struct opie *));
int __opiewriterec __P((struct opie *)); int __opiewriterec __P((struct opie *));
int __opieparsechallenge __P((char *buffer, int *algorithm, int *sequence, char **seed, int *exts)); int __opieparsechallenge __P((char *buffer, int *algorithm, int *sequence, char **seed, int *exts));
VOIDRET opiehashlen __P((int algorithm, VOIDPTR in, struct opie_otpkey *out, int n));
__END_DECLS __END_DECLS
#define opiestrncpy(dst, src, n) \ #define opiestrncpy(dst, src, n) \

View File

@ -38,6 +38,7 @@ $FreeBSD$
#include <sys/param.h> #include <sys/param.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#if HAVE_UNISTD_H #if HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>

View File

@ -45,6 +45,7 @@ $FreeBSD$
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include "opie.h" #include "opie.h"