From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by dpdk.org (Postfix) with ESMTP id 45E3B1B6D4 for ; Wed, 9 May 2018 17:33:03 +0200 (CEST) Received: by mail-pg0-f66.google.com with SMTP id z70-v6so2636099pgz.3 for ; Wed, 09 May 2018 08:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yNBFVsyNlQsG84MxxTWY8qc77nYziaPCiiZKQYlvqvA=; b=NNTyFq/FKuWhVYpO4WInS/ITvoipngEGbKajmp9i0naKArr9aiRF+43Y13VUfz/NiD /zTbbvNNxTIvfI3zyxTUrYjSNZpNNc4pvX59SaebuxK1+SSUfPTFfKduTRqAkqkAmWng CCW8u/fyq4UOl5JgpBRnjO0s1hpCZrOlASnYgdMManpgCRMlhfwkWRWHxTm1L5e379Bp vQ0SeLeLD/RAa0rYfWf4hK5fZAtwRrqFbovnMsmSPcGadey95ijuZBXe2ITjpon0O3RX IASLRt3Sw6ZXNskcDM7PQeF2yVG5YLSwF9T+HFQHU4mMEvle5RpeR5zUjgqkCV/zFYfO hx3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yNBFVsyNlQsG84MxxTWY8qc77nYziaPCiiZKQYlvqvA=; b=tZfzhEeWDsvLDUhAGtuYOq1MX1A3UElk89GEADdoszIfB1nVdSJou4/jzhzt3vnPUf 9YCH/bnqodhmX0w+eMRIu/QcdCz4XAb0dzVCOV8sBZ9Xt63vm4BajN5w5Eeg28g7jwyG v1rI1UNkSzxxSI1T6N8Xu5TH0yNfU+MFn28ROCKFk07bKFKeyy5wULgxvdYkhcKd1PjT 6rJK9+VgMCLogLVnQ34BkUJ5L1wZoRwjfbkKwDtfanIvLGU0tfQPi6qIY3aPgGMvzFpW Vp+qX5BxUsaBhnFwV8dRKyjxjCOjYJ680daP6bY0jE+H8L951vdEQquL3kzrTbKVZlAK c/7w== X-Gm-Message-State: ALKqPwc/F6a2jNAyH6pH0qWVwdv+3DA9QENMzzMr9s64pDvkH6WI9p5v 9CQeNGHL/2hvUclc4fDXBya06xtxYb4= X-Google-Smtp-Source: AB8JxZphsdmoVS7o+qgnbdyZkzdkH/S5cUbRjSjO7nTZU0eail/MYsavVVt7cJC/LV6LT5AcNwnXDw== X-Received: by 2002:a63:6d4a:: with SMTP id i71-v6mr4124459pgc.70.1525879983105; Wed, 09 May 2018 08:33:03 -0700 (PDT) Received: from xeon-e3 (204-195-35-107.wavecable.com. [204.195.35.107]) by smtp.gmail.com with ESMTPSA id i186-v6sm43937336pge.40.2018.05.09.08.33.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 May 2018 08:33:03 -0700 (PDT) Date: Wed, 9 May 2018 08:33:00 -0700 From: Stephen Hemminger To: Andy Green Cc: dev@dpdk.org Message-ID: <20180509083300.1b2ca33e@xeon-e3> In-Reply-To: <152582951611.6809.6625415049400391374.stgit@localhost.localdomain> References: <152582834896.6809.14521072557832633661.stgit@localhost.localdomain> <152582951611.6809.6625415049400391374.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 13/18] drivers/net/vdev: readlink inputs cannot be aliased X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2018 15:33:04 -0000 On Wed, 09 May 2018 09:31:56 +0800 Andy Green wrote: > /home/agreen/projects/dpdk/drivers/net/vdev_netvsc/ > vdev_netvsc.c:335:2:error: passing argument 2 to restrict- > qualified parameter aliases with argument 1 [-Werror=restrict] > ret = readlink(buf, buf, size); > ^~~ > > Signed-off-by: Andy Green > --- > drivers/net/vdev_netvsc/vdev_netvsc.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c > index c321a9f1b..e0d3c1c7c 100644 > --- a/drivers/net/vdev_netvsc/vdev_netvsc.c > +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c > @@ -327,12 +327,14 @@ static int > vdev_netvsc_sysfs_readlink(char *buf, size_t size, const char *if_name, > const char *relpath) > { > + char in[160]; > int ret; > > - ret = snprintf(buf, size, "/sys/class/net/%s/%s", if_name, relpath); > - if (ret == -1 || (size_t)ret >= size) > + ret = snprintf(in, sizeof(buf) - 1, "/sys/class/net/%s/%s", > + if_name, relpath); This is wrong. buf is char * and sizeof(char *) - 1 is 3