From 513bdaa1418a580a4ad07e6e220086d1daba796c Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Mon, 13 Mar 2017 17:15:45 +0000 Subject: [PATCH] Fix -Wunused-but-set-warning with `ret` While here, resolve Coverity warnings by demonstrating that vfprintf's return value is being explicitly ignored. MFC after: 1 week Reported by: gcc 6.3.0 Tested with: clang, gcc 4.2.1, gcc 6.3.0 Sponsored by: Dell EMC Isilon --- sbin/dhclient/tests/fake.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sbin/dhclient/tests/fake.c b/sbin/dhclient/tests/fake.c index c204d49402c5..91bbc6e42792 100644 --- a/sbin/dhclient/tests/fake.c +++ b/sbin/dhclient/tests/fake.c @@ -14,7 +14,7 @@ error(char *fmt, ...) va_list ap; va_start(ap, fmt); - vfprintf(stderr, fmt, ap); + (void)vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, "\n"); @@ -24,11 +24,10 @@ error(char *fmt, ...) int warning(char *fmt, ...) { - int ret; va_list ap; va_start(ap, fmt); - ret = vfprintf(stderr, fmt, ap); + (void)vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, "\n");