From: Jim Meyering Date: Fri, 11 Jun 2010 20:09:27 +0000 (+0200) Subject: test-sys_socket: mark variables as used more readably X-Git-Tag: v0.1~4071 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=bfbd822767f532ab05e24bda5b67b992f3562321;hp=af5c3b38e1c9897a7a53fa7285ea58aabb3963b9;p=gnulib.git 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. --- 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; }