[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] test-sys_socket: avoid set-but-not-used warnings from gcc
From: |
Jim Meyering |
Subject: |
[PATCH] test-sys_socket: avoid set-but-not-used warnings from gcc |
Date: |
Fri, 11 Jun 2010 11:28:20 +0200 |
One more.
Without the patch below, I'd get these:
test-sys_socket.c:36:15: warning: variable 'i' set but not used
[-Wunused-but-set-variable]
test-sys_socket.c:35:27: warning: variable 'x' set but not used
[-Wunused-but-set-variable]
>From ef5acf202788003cdc70813756e173cd6b7dd5a1 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 11 Jun 2010 11:26:31 +0200
Subject: [PATCH] test-sys_socket: avoid set-but-not-used warnings from gcc
* tests/test-sys_socket.c (main): Use "i" and "x", in order to
avoid warning about set-but-not-used variables.
---
ChangeLog | 4 ++++
tests/test-sys_socket.c | 2 +-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 456a793..726e66a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2010-06-11 Jim Meyering <address@hidden>
+ test-sys_socket: avoid set-but-not-used warnings from gcc
+ * tests/test-sys_socket.c (main): Use "i" and "x", in order to
+ avoid warning about set-but-not-used variables.
+
test-xvasprintf: avoid 'const' discard warnings
* tests/test-xvasprintf.c (test_xvasprintf, test_xasprintf): Use
"const" when assigning from literal strings.
diff --git a/tests/test-sys_socket.c b/tests/test-sys_socket.c
index badf308..6ea6a73 100644
--- a/tests/test-sys_socket.c
+++ b/tests/test-sys_socket.c
@@ -49,5 +49,5 @@ main (void)
x.ss_family = 42;
i = 42;
- return 0;
+ return ! (i + x.ss_family);
}
--
1.7.1.501.g23b46
- [PATCH] test-sys_socket: avoid set-but-not-used warnings from gcc,
Jim Meyering <=