From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 84F9E4BFE for ; Wed, 20 Mar 2013 17:07:24 +0100 (CET) Received: by mail-wg0-f51.google.com with SMTP id 8so1504945wgl.30 for ; Wed, 20 Mar 2013 09:06:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references:x-gm-message-state; bh=rN04d1F+9tbVLtDxYJa95nWWDtlmb+AUPOaAI7Yh7Dk=; b=KAPEmEeOOxh6N+bKHy9p+s6mLJFdkW+uoRlvqimEf/v8c8h5KnZo2ELno65VIyAEbl u0X0dCQ81r9icIhq1V7dSfXrn5Y4YATBFSaFgX268bwKKomDXgPMBK00q1kMGHTXr07R eQHwe+i24k0IFd6abXR8lReK7uV4QpiLz1e1Xi5X4LLJTY9qmRKJLy88ZLqzD/h/z4yg iko8E+epOiIGqeN1i7MgsmUMHEB4L3OYFrwJNOUlcnVH2xfCpd8Rp4U8AJz78wLa/zsS OzdfZ1ww/YeDWlyTaJx/uLw6hl/aSbGn7kf+BYq0UjyaoiXRbMigHPKqa0BolL2pJVVq MM/A== X-Received: by 10.194.81.40 with SMTP id w8mr11611819wjx.14.1363795584764; Wed, 20 Mar 2013 09:06:24 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPS id fv2sm4058539wib.6.2013.03.20.09.06.22 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 20 Mar 2013 09:06:23 -0700 (PDT) Received: by 6wind.com (sSMTP sendmail emulation); Wed, 20 Mar 2013 17:06:22 +0100 From: Thomas Monjalon To: dev@dpdk.org Date: Wed, 20 Mar 2013 17:04:54 +0100 Message-Id: <3e7f7fc9c0d5e01efa26eee1c1f4a23b8398890d.1363795499.git.thomas.monjalon@6wind.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQkmxWBF0vXXJJP+x7E/9zgKdYF2mbnNwiN5+l2QRuAeLZ3Liu151UKhwh1ALMgGMsJAR2Kp Subject: [dpdk-dev] [PATCH 06/22] app: fix volatile read for GCC >= 4.6 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2013 16:07:25 -0000 From: Ivan Boule When a memory address must be read, for instance a [mapped] PCI register, the read value is assigned to a local variable that is not used after, as for instance: x = *((uint8_t *) mem_addr); Such instructions do not compile with gcc 4.6. The fix consists in adding the "volatile" attribute to the accessed data type and to not assign the read value: *((volatile uint8_t *) mem_addr); Acked-by: Olivier Matz Signed-off-by: Ivan Boule --- app/test/test_memory.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/app/test/test_memory.c b/app/test/test_memory.c index 8a25eca..96d35d9 100644 --- a/app/test/test_memory.c +++ b/app/test/test_memory.c @@ -61,7 +61,6 @@ test_memory(void) uint64_t s; unsigned i, j; const struct rte_memseg *mem; - volatile uint8_t x; /* * dump the mapped memory: the python-expect script checks @@ -83,8 +82,7 @@ test_memory(void) /* check memory */ for (j = 0; j