summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2018-06-07 12:11:30 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-06-10 11:30:24 +0200
commit3f21d8601ddbb27f443f6a8fdf91ebe715d5cb94 (patch)
tree3330c81303acf0130dfd82f63a763b772fae7551
parent05ccb42f8eb197ba4f7244bb4a849c5a4ef028f9 (diff)
downloadgnutls-3f21d8601ddbb27f443f6a8fdf91ebe715d5cb94.tar.gz
Fix warnings seen on OpenCSW Solaris 10
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de> Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rw-r--r--doc/examples/udp.c5
-rw-r--r--lib/system/fastopen.c4
-rw-r--r--lib/x509/verify-high.c4
-rw-r--r--tests/no-signal.c2
-rw-r--r--tests/rng-sigint.c2
-rw-r--r--tests/srp.c2
6 files changed, 12 insertions, 7 deletions
diff --git a/doc/examples/udp.c b/doc/examples/udp.c
index 184f31718d..989ffcc6bf 100644
--- a/doc/examples/udp.c
+++ b/doc/examples/udp.c
@@ -24,7 +24,10 @@ extern int udp_connect(void)
{
const char *PORT = "5557";
const char *SERVER = "127.0.0.1";
- int err, sd, optval;
+ int err, sd;
+#if defined(IP_DONTFRAG) || defined(IP_MTU_DISCOVER)
+ int optval;
+#endif
struct sockaddr_in sa;
/* connects to server
diff --git a/lib/system/fastopen.c b/lib/system/fastopen.c
index 18e82ee446..0f673b7c49 100644
--- a/lib/system/fastopen.c
+++ b/lib/system/fastopen.c
@@ -83,7 +83,7 @@ tfo_writev(gnutls_transport_ptr_t ptr, const giovec_t * iovec, int iovec_cnt)
tfo_st *p = ptr;
int fd = p->fd;
struct msghdr hdr;
- int ret, on = 1;
+ int ret;
memset(&hdr, 0, sizeof(hdr));
hdr.msg_iov = (struct iovec *)iovec;
@@ -94,6 +94,8 @@ tfo_writev(gnutls_transport_ptr_t ptr, const giovec_t * iovec, int iovec_cnt)
# if defined(TCP_FASTOPEN_LINUX)
if (!p->connect_only) {
+ int on = 1;
+
if (setsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN, &on, sizeof(on)) == -1)
_gnutls_debug_log("Failed to set socket option FASTOPEN\n");
diff --git a/lib/x509/verify-high.c b/lib/x509/verify-high.c
index 18906ddc1a..4e2faa5a86 100644
--- a/lib/x509/verify-high.c
+++ b/lib/x509/verify-high.c
@@ -347,8 +347,6 @@ static int
advance_iter(gnutls_x509_trust_list_t list,
gnutls_x509_trust_list_iter_t iter)
{
- int ret;
-
if (iter->node_index < list->size) {
++iter->ca_index;
@@ -366,7 +364,7 @@ advance_iter(gnutls_x509_trust_list_t list,
#ifdef ENABLE_PKCS11
if (list->pkcs11_token != NULL) {
if (iter->pkcs11_list == NULL) {
- ret = gnutls_pkcs11_obj_list_import_url2(&iter->pkcs11_list, &iter->pkcs11_size,
+ int ret = gnutls_pkcs11_obj_list_import_url2(&iter->pkcs11_list, &iter->pkcs11_size,
list->pkcs11_token, (GNUTLS_PKCS11_OBJ_FLAG_PRESENT_IN_TRUSTED_MODULE|GNUTLS_PKCS11_OBJ_FLAG_CRT|GNUTLS_PKCS11_OBJ_FLAG_MARK_CA|GNUTLS_PKCS11_OBJ_FLAG_MARK_TRUSTED), 0);
if (ret < 0)
return gnutls_assert_val(ret);
diff --git a/tests/no-signal.c b/tests/no-signal.c
index 0894632c8d..3b08417ff4 100644
--- a/tests/no-signal.c
+++ b/tests/no-signal.c
@@ -47,7 +47,7 @@ int main()
# ifndef MSG_NOSIGNAL
-int main()
+int main(void)
{
exit(77);
}
diff --git a/tests/rng-sigint.c b/tests/rng-sigint.c
index e48646a2f5..668be53481 100644
--- a/tests/rng-sigint.c
+++ b/tests/rng-sigint.c
@@ -100,6 +100,8 @@ void doit(void)
_rnd_system_entropy_deinit();
}
#else
+void doit(void); /* prototype to avoid warning with -Wmissing-prototypes */
+
void doit(void)
{
exit(77);
diff --git a/tests/srp.c b/tests/srp.c
index 78eed5b1b0..6b2d953c00 100644
--- a/tests/srp.c
+++ b/tests/srp.c
@@ -277,7 +277,7 @@ static void start(const char *name, const char *prio, const char *user, const ch
int ret;
success("testing: %s\n", name);
- ret = socketpair(AF_LOCAL, SOCK_STREAM, 0, fd);
+ ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd);
if (ret < 0) {
perror("socketpair");
exit(1);