Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1043905imm; Fri, 14 Sep 2018 10:13:56 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZeK1YLvBIT/EJeqVXrB39+z81shbftjoK9C7/FzTXGl5UYS7s3SoCg+FMmmR8ncDJ7VNcI X-Received: by 2002:a17:902:b03:: with SMTP id 3-v6mr13428764plq.156.1536945236929; Fri, 14 Sep 2018 10:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536945236; cv=none; d=google.com; s=arc-20160816; b=rTkaYdqfRngSH9yeGtzS5gl7kQ68UptDYEWmPxvPDTc+U1IaR7HA9Aij49GS9kGpQS bdpeIQTi/6kw1ETwaauV93ql64tC9nOb6Lorz8JxfnGGBuVpoGagcuA9yayjpcUS2wma 0P2hzWJVlRaGJSfLDJNR7tFSLN7N0KiImFRDnerHt49a22abednfbuNfEDyD0Z3iFT9G WxS6U9nmoocjSwIgugrKHTxvseFlYdDfMYCOjWB6duyKhwCvnXfnlUAJ8U9eD0xcizar 9dHMpefiFbeu9HqVlJj6vImn5BVuyaApKDqJ/9oYrd1BLusmSker4PgPxwxGIbjcQS49 UeIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=R3g2k36CVr9nMcrr8XW96ahHO5waeqenQFbG9f0CjCs=; b=PVdeSOKei6hLPo+lgYoEBLo57oMzVeq6OOoELNY47X/+ziGZYvE0YJhZVjeNTsv6cZ PHhJJiZqQBOltap4qd14y4EXJKPdQWMiLjBuae8N7KL/Mgd5Gome2ZeIpxzBTu4cLy2Y jfuhfXJBaa/txXC0P0NFZ5VDAweaJD1w+3iVLPsJhSgDfsyhNzPEM/zTVK45w9xDtNbL ALh0uhYkCO6q6IaReZr5T4JLhoG7N7+9yC1jZdmFhBcf3Gqr+uIk08tHqKXH63JQyLK1 Bo99ngYEZUZKlYGSnXPTwOQ7IywBS+w71Toiv93sdNjUkliASej6S3K3AQduHQNxD4vR cYNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Nhx1sfE2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j61-v6si7000228plb.49.2018.09.14.10.13.40; Fri, 14 Sep 2018 10:13:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Nhx1sfE2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727996AbeINW2P (ORCPT + 99 others); Fri, 14 Sep 2018 18:28:15 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:38254 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbeINW2O (ORCPT ); Fri, 14 Sep 2018 18:28:14 -0400 Received: by mail-qt0-f196.google.com with SMTP id x7-v6so9380317qtk.5; Fri, 14 Sep 2018 10:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=R3g2k36CVr9nMcrr8XW96ahHO5waeqenQFbG9f0CjCs=; b=Nhx1sfE2lZdglIcdHNx7A05PybrQ6w/DCbK8LEuokQihQExagKCWvS7xiEGf7XR+qv qBZISpXcgnr99yxqVVtPq1kqjAuBVt7Mw58yJ7EoMx6u09HaVE1ZMKnuaJkgoolpc/hJ AjSii9KOc4xG0Oo7XiyzDW419uc4TR4dgZd6Xe6V1SHuEIc1D4p3SKuf2SFMU7cC+bGy RuAXEHJtub+MKKLM7fpQouMf6JwVbFJ9YLViQgFsFEKmUuj6sk4e1n8famkti7HoMk6F zW7TOvn/jLukniMuRY+GJ/ydWZp1zkHKXTa3E4Rq3jhLj/ZbRhaOZ4UQMR05uaN3SSXN 6+Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=R3g2k36CVr9nMcrr8XW96ahHO5waeqenQFbG9f0CjCs=; b=Lp5Yk+lvu3YTtHRE+5kCgBhb233M04i3kkLnd3ZlNR3ELHg11tDKUvNf2oSW8spWM8 2k9mvAsL2zRZZfizQdOW5up8+XkymHI8H3YTmn9Kh3Klgz7HiyISDMCy5eky45awU5+P +I+83zqY+hmyGD/gIeQoUNrezwsQJehUP6inbzW7hbRN1c5h1zShNjDHr6mq40UNJ+0A gHb4S6tts8qqZDwj2avwi30OuYArGHCaKNTYxCnVJySspvNCdBM3i3RF59lz/+jG2zcR nmqn1eN1SilM7QlFTLNa5ICSYeYzPezUjkty8wZUbGWnR8cCMcmUSkKk9E2/sENF86ID ZE9w== X-Gm-Message-State: APzg51A45s1z+I08q9D79Jh8tSlBYSzJbS10GHY215Nu/QhLpvqlFVDR 0H42HE7PuWlCO5NxP7LaCZl/YZ2S9/6oLU3r3Y/E2HsSqBM= X-Received: by 2002:a0c:aed9:: with SMTP id n25-v6mr9669084qvd.10.1536945170621; Fri, 14 Sep 2018 10:12:50 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac8:7494:0:0:0:0:0 with HTTP; Fri, 14 Sep 2018 10:12:29 -0700 (PDT) In-Reply-To: <20180914104427.3900-1-harshitjain6751@gmail.com> References: <20180914104427.3900-1-harshitjain6751@gmail.com> From: Miguel Ojeda Date: Fri, 14 Sep 2018 19:12:29 +0200 Message-ID: Subject: Re: [PATCH] scripts: unifdef: fix stringop-truncation warning To: Harshit Jain Cc: stable@vger.kernel.org, Harshit Jain , Tony Finch , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Harshit, On Fri, Sep 14, 2018 at 12:44 PM, Harshit Jain wrote: > From: Harshit Jain > > * This commit resolves the following warning when the mainline kernel is build with the android environment. Typo: built > > -> warning :-> https://gist.github.com/dev-harsh1998/757427b16a58f5498db3d87212a9651b Try to avoid links to external pages (specially if they are only 2 lines :-). > > * This warning is persistant in all the currently maintained android kernel i.e 3.18, 4.4, 4.9, 4.14. Typos: persistent, kernels, i.e. > > Signed-off-by: Harshit Jain > --- > scripts/unifdef.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/scripts/unifdef.c b/scripts/unifdef.c > index 7493c0ee51cc..4ce008eda362 100644 > --- a/scripts/unifdef.c > +++ b/scripts/unifdef.c > @@ -395,8 +395,8 @@ usage(void) > * When we have processed a group that starts off with a known-false > * #if/#elif sequence (which has therefore been deleted) followed by a > * #elif that we don't understand and therefore must keep, we edit the > - * latter into a #if to keep the nesting correct. We use strncpy() to > - * overwrite the 4 byte token "elif" with "if " without a '\0' byte. > + * latter into a #if to keep the nesting correct. We use the memcpy() > + * from the string header overwrite the 4 byte token "elif" with "if ". > * > * When we find a true #elif in a group, the following block will > * always be kept and the rest of the sequence after the next #elif or > @@ -450,7 +450,7 @@ static void Idrop (void) { Fdrop(); ignoreon(); } > static void Itrue (void) { Ftrue(); ignoreon(); } > static void Ifalse(void) { Ffalse(); ignoreon(); } > /* modify this line */ > -static void Mpass (void) { strncpy(keyword, "if ", 4); Pelif(); } > +static void Mpass (void) { memcpy(keyword, "if ", 4); Pelif(); } Seems like keyword shouldn't use __attribute__((nonstring)), so this looks right. Cheers, Miguel > static void Mtrue (void) { keywordedit("else"); state(IS_TRUE_MIDDLE); } > static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); } > static void Melse (void) { keywordedit("endif"); state(IS_FALSE_ELSE); } > -- > 2.18.0 >