From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXyaO-0008Bg-RE for qemu-devel@nongnu.org; Mon, 03 Aug 2009 10:32:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXyaJ-00088M-Ow for qemu-devel@nongnu.org; Mon, 03 Aug 2009 10:32:24 -0400 Received: from [199.232.76.173] (port=41666 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXyaH-000886-Pk for qemu-devel@nongnu.org; Mon, 03 Aug 2009 10:32:19 -0400 Received: from mx20.gnu.org ([199.232.41.8]:46858) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MXyaH-0003nc-97 for qemu-devel@nongnu.org; Mon, 03 Aug 2009 10:32:17 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXyaF-0000gV-24 for qemu-devel@nongnu.org; Mon, 03 Aug 2009 10:32:15 -0400 From: Nathan Froyd Date: Mon, 3 Aug 2009 07:32:13 -0700 Message-Id: <1249309933-4584-1-git-send-email-froydnj@codesourcery.com> Subject: [Qemu-devel] [PATCH] eliminate errors about unused results in block/vpc.c List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org These errors come up when compiling with gcc-4.3.3 and some older headers: /scratch/froydnj/qemu.git/block/vpc.c: In function 'vpc_create': /scratch/froydnj/qemu.git/block/vpc.c:514: error: value computed is not used /scratch/froydnj/qemu.git/block/vpc.c:516: error: value computed is not used /scratch/froydnj/qemu.git/block/vpc.c:517: error: value computed is not used /scratch/froydnj/qemu.git/block/vpc.c:566: error: value computed is not used Just add void casts to silence the compiler. Signed-off-by: Nathan Froyd --- block/vpc.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) v2: resent, including Signed-off-by this time. diff --git a/block/vpc.c b/block/vpc.c index ba482e9..b67e9ce 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -511,10 +511,10 @@ static int vpc_create(const char *filename, QEMUOptionParameter *options) // Prepare the Hard Disk Footer memset(buf, 0, 1024); - strncpy(footer->creator, "conectix", 8); + (void) strncpy(footer->creator, "conectix", 8); // TODO Check if "qemu" creator_app is ok for VPC - strncpy(footer->creator_app, "qemu", 4); - strncpy(footer->creator_os, "Wi2k", 4); + (void) strncpy(footer->creator_app, "qemu", 4); + (void) strncpy(footer->creator_os, "Wi2k", 4); footer->features = be32_to_cpu(0x02); footer->version = be32_to_cpu(0x00010000); @@ -563,7 +563,7 @@ static int vpc_create(const char *filename, QEMUOptionParameter *options) // Prepare the Dynamic Disk Header memset(buf, 0, 1024); - strncpy(dyndisk_header->magic, "cxsparse", 8); + (void) strncpy(dyndisk_header->magic, "cxsparse", 8); dyndisk_header->data_offset = be64_to_cpu(0xFFFFFFFF); dyndisk_header->table_offset = be64_to_cpu(3 * 512); -- 1.6.3.2