From bfbd822767f532ab05e24bda5b67b992f3562321 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 11 Jun 2010 22:09:27 +0200 Subject: [PATCH] test-sys_socket: mark variables as used more readably * tests/test-sys_socket.c (main): Mark otherwise unused variables as "used" explicitly via (void) statement casts. This is more readable than using them in an artificial return expression. Suggestion from Bruno Haible. --- ChangeLog | 8 ++++++++ tests/test-sys_socket.c | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a64e05c5c..7b6394d0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-06-11 Jim Meyering + + test-sys_socket: mark variables as used more readably + * tests/test-sys_socket.c (main): Mark otherwise unused variables + as "used" explicitly via (void) statement casts. This is more + readable than using them in an artificial return expression. + Suggestion from Bruno Haible. + 2010-06-11 Bruno Haible Avoid some more warnings from "gcc -Wwrite-strings". diff --git a/tests/test-sys_socket.c b/tests/test-sys_socket.c index 6ea6a7390..1c3b5607c 100644 --- a/tests/test-sys_socket.c +++ b/tests/test-sys_socket.c @@ -49,5 +49,9 @@ main (void) x.ss_family = 42; i = 42; - return ! (i + x.ss_family); + /* Tell the compiler that these variables are used. */ + (void) x; + (void) i; + + return 0; } -- 2.11.0