summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-08-28 17:26:44 +0200
committerSimon Josefsson <simon@josefsson.org>2008-08-28 17:26:44 +0200
commit0d538af03deb419020897d18741a1038552e07ca (patch)
tree27e2e50ce3ab28492de6f0d1f25095dcc13d2e01
parentb251146cb5b24daa964da3ca2541b0077b2c167e (diff)
downloadgnutls-0d538af03deb419020897d18741a1038552e07ca.tar.gz
Fix warnings.
-rw-r--r--configure.in10
-rw-r--r--lib/auth_rsa.c4
-rw-r--r--lib/debug.c3
-rw-r--r--lib/gnutls_cert.c2
-rw-r--r--lib/gnutls_dh.c3
-rw-r--r--lib/gnutls_errors.c14
-rw-r--r--lib/gnutls_extensions.c12
-rw-r--r--lib/gnutls_handshake.c22
-rw-r--r--lib/gnutls_v2_compat.c3
9 files changed, 29 insertions, 44 deletions
diff --git a/configure.in b/configure.in
index 5d96d38eca..19fbd51f0f 100644
--- a/configure.in
+++ b/configure.in
@@ -133,8 +133,16 @@ if test $ac_cv_c_compiler_gnu != no; then
if test x$opt_developer_mode = xyes; then
AC_MSG_CHECKING([whether gcc supports various warning flags])
_gcc_cflags_save="$CFLAGS"
- CFLAGS="${CFLAGS} -Wall -W -Wchar-subscripts -Wformat-security -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused -Wfloat-equal -Wtraditional-conversion -Wdeclaration-after-statement -Wundef -Wshadow -Wunsafe-loop-optimizations -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wconversion -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wpacked -Wpadded -Wredundant-decls -Wnested-externs -Wunreachable-code -Winline -Wvla -Wvolatile-register-var -Wdisabled-optimization -Wstack-protector -Woverlength-strings"
+ CFLAGS="${CFLAGS} -Wall -W -Wchar-subscripts -Wformat-security -Wnonnull -Winit-self -Wmissing-include-dirs -Wunused -Wno-unused-parameter -Wfloat-equal -Wdeclaration-after-statement -Wshadow -Wunsafe-loop-optimizations -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wvla -Wvolatile-register-var -Wdisabled-optimization -Wstack-protector -Woverlength-strings"
# -Wtraditional: warns on #elif which we use often
+ # -Wundef: warns on '#if GNULIB_PORTCHECK' etc in gnulib headers
+ # -Wpadded: many of our structs are not optimized for padding
+ # -Wtraditional-conversion: we catch missing prototypes anyway
+ # -Wno-unused-parameter: added because -Wunused cause too many warns
+ # -Wunreachable-code: appears to return many false positives
+ # -Wconversion: too many warnings for now
+ # -Wswitch-default: too many warnings for now
+ # -Wswitch-enum: too many warnings for now
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_warns=yes,_gcc_warns=no)
AC_MSG_RESULT($_gcc_warns)
if test x"$_gcc_warns" != xyes ; then
diff --git a/lib/auth_rsa.c b/lib/auth_rsa.c
index 6e95ce17ce..894e2e54af 100644
--- a/lib/auth_rsa.c
+++ b/lib/auth_rsa.c
@@ -65,7 +65,7 @@ const mod_auth_st rsa_auth_struct = {
/* This function reads the RSA parameters from peer's certificate;
*/
-int
+static int
_gnutls_get_public_rsa_params (gnutls_session_t session,
bigint_t params[MAX_PUBLIC_PARAMS_SIZE],
int *params_len)
@@ -146,7 +146,7 @@ _gnutls_get_public_rsa_params (gnutls_session_t session,
/* This function reads the RSA parameters from the private key
*/
-int
+static int
_gnutls_get_private_rsa_params (gnutls_session_t session,
bigint_t ** params, int *params_size)
{
diff --git a/lib/debug.c b/lib/debug.c
index f60c4776cc..6a6805fb44 100644
--- a/lib/debug.c
+++ b/lib/debug.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation
+ * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation
*
* Author: Nikos Mavrogiannopoulos
*
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <gcrypt.h>
+#include "debug.h"
#ifdef DEBUG
diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c
index 751d9354c7..2c891ccdc8 100644
--- a/lib/gnutls_cert.c
+++ b/lib/gnutls_cert.c
@@ -504,7 +504,7 @@ _gnutls_x509_get_raw_crt_expiration_time (const gnutls_datum_t * cert)
* Returns a negative error code in case of an error, or GNUTLS_E_NO_CERTIFICATE_FOUND if no certificate was sent.
*
-*/
-int
+static int
_gnutls_openpgp_crt_verify_peers (gnutls_session_t session,
unsigned int *status)
{
diff --git a/lib/gnutls_dh.c b/lib/gnutls_dh.c
index 46069eeb45..516d10a0e4 100644
--- a/lib/gnutls_dh.c
+++ b/lib/gnutls_dh.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
+ * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2008 Free Software Foundation
*
* Author: Nikos Mavrogiannopoulos
*
@@ -24,6 +24,7 @@
#include <gnutls_int.h>
#include <gnutls_errors.h>
+#include <gnutls_dh.h>
/*
diff --git a/lib/gnutls_errors.c b/lib/gnutls_errors.c
index 683fbcba2c..a9a1f3a741 100644
--- a/lib/gnutls_errors.c
+++ b/lib/gnutls_errors.c
@@ -343,20 +343,6 @@ gnutls_strerror (int error)
return _(ret);
}
-/* This will print the actual define of the
- * given error code.
- */
-const char *
-_gnutls_strerror (int error)
-{
- const char *ret = NULL;
-
- /* avoid prefix */
- GNUTLS_ERROR_ALG_LOOP (ret = p->_name);
-
- return _(ret);
-}
-
int
_gnutls_asn2err (int asn_err)
{
diff --git a/lib/gnutls_extensions.c b/lib/gnutls_extensions.c
index 45e9431f0c..ac3a2a2a81 100644
--- a/lib/gnutls_extensions.c
+++ b/lib/gnutls_extensions.c
@@ -63,18 +63,6 @@ _gnutls_ext_func_recv (uint16_t type, gnutls_ext_parse_type_t parse_type)
return NULL;
}
-const char *
-_gnutls_extension_get_name (uint16_t type)
-{
- size_t i;
-
- for (i = 0; i < extfunc_size; i++)
- if (extfunc[i].type == type)
- return extfunc[i].name;
-
- return NULL;
-}
-
/* Checks if the extension we just received is one of the
* requested ones. Otherwise it's a fatal error.
*/
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 04cfd06271..39d4779e30 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -193,7 +193,7 @@ _gnutls_ssl3_finished (gnutls_session_t session, int type, opaque * ret)
#define SERVER_MSG "server finished"
#define CLIENT_MSG "client finished"
#define TLS_MSG_LEN 15
-int
+static int
_gnutls_finished (gnutls_session_t session, int type, void *ret)
{
const int siz = TLS_MSG_LEN;
@@ -344,7 +344,7 @@ _gnutls_user_hello_func (gnutls_session session,
* or version 2.0 client hello (only for compatibility
* since SSL version 2.0 is not supported).
*/
-int
+static int
_gnutls_read_client_hello (gnutls_session_t session, opaque * data,
int datalen)
{
@@ -528,7 +528,7 @@ _gnutls_handshake_hash_pending (gnutls_session_t session)
* and initializing encryption. This is the first encrypted message
* we send.
*/
-int
+static int
_gnutls_send_finished (gnutls_session_t session, int again)
{
uint8_t data[36];
@@ -557,9 +557,8 @@ _gnutls_send_finished (gnutls_session_t session, int again)
}
else
{ /* TLS 1.0 */
- ret =
- _gnutls_finished (session,
- session->security_parameters.entity, data);
+ ret = _gnutls_finished (session,
+ session->security_parameters.entity, data);
data_size = 12;
}
@@ -583,7 +582,7 @@ _gnutls_send_finished (gnutls_session_t session, int again)
/* This is to be called after sending our finished message. If everything
* went fine we have negotiated a secure connection
*/
-int
+static int
_gnutls_recv_finished (gnutls_session_t session)
{
uint8_t data[36], *vrfy;
@@ -871,7 +870,7 @@ _gnutls_server_select_comp_method (gnutls_session_t session,
* GNUTLS_E_AGAIN or GNUTLS_E_INTERRUPTED, then it must be called again
* (until it returns ok), with NULL parameters.
*/
-int
+static int
_gnutls_send_empty_handshake (gnutls_session_t session,
gnutls_handshake_description_t type, int again)
{
@@ -2160,7 +2159,7 @@ _gnutls_handshake_hash_init (gnutls_session_t session)
return 0;
}
-int
+static int
_gnutls_send_supplemental (gnutls_session_t session, int again)
{
int ret = 0;
@@ -2190,7 +2189,7 @@ _gnutls_send_supplemental (gnutls_session_t session, int again)
return ret;
}
-int
+static int
_gnutls_recv_supplemental (gnutls_session_t session)
{
uint8_t *data = NULL;
@@ -2693,9 +2692,10 @@ _gnutls_handshake_common (gnutls_session_t session)
int
_gnutls_generate_session_id (opaque * session_id, uint8_t * len)
{
- *len = TLS_MAX_SESSION_ID_SIZE;
int ret;
+ *len = TLS_MAX_SESSION_ID_SIZE;
+
ret = _gnutls_rnd (GNUTLS_RND_NONCE, session_id, *len);
if (ret < 0)
{
diff --git a/lib/gnutls_v2_compat.c b/lib/gnutls_v2_compat.c
index 5f692e6925..02dcca5eac 100644
--- a/lib/gnutls_v2_compat.c
+++ b/lib/gnutls_v2_compat.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation
+ * Copyright (C) 2001, 2004, 2005, 2006, 2008 Free Software Foundation
*
* Author: Nikos Mavrogiannopoulos
*
@@ -40,6 +40,7 @@
#include "gnutls_db.h"
#include "gnutls_extensions.h"
#include "gnutls_auth_int.h"
+#include "gnutls_v2_compat.h"
/* This selects the best supported ciphersuite from the ones provided */
static int