Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3284701imm; Sun, 19 Aug 2018 17:03:43 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwxhimnOH7iZia2Zg1NzOBaWHQmNU23AmMESSB1VVP2GBzX1ILGxEw8zrBeNuGV/Fs/r2mJ X-Received: by 2002:a62:be03:: with SMTP id l3-v6mr45825862pff.138.1534723423087; Sun, 19 Aug 2018 17:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534723423; cv=none; d=google.com; s=arc-20160816; b=wLw748CvrgjJcMFMV+kcl/fJQYP+bfGCF291RRO/OH0vFtQ5/Mwn+U8ZhHf+AyOdLL fIDIC1sAWyVJNC/JLeMcNfjl2T3pExgeQagj7r8Dc0M/S5TtD72SXY3GuCoFkJhzyhxh 80AHCWLQ/s/fPatJ4f5pvz0quhVojmQh7ip+IUMN4ecwh+qbBtnhhPS8LJHTr06FEy2j xdxeuUbPtFLIAvDxXQ1P9kBsjm1VmDoV01Oe+sSODvLj30EZgiuQlvLMuIciMAsmLlox vRHqy1T4zJno2cwKdmavEQubSloIxLoMz+sPDV4VUzdUqZilYtUmnrqZ/FR4hXzxRE7G t0Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=/2ijYlux+YbKK4Pgbo7v9AAZVjfOv2k2GoIBwaOV/jE=; b=zGRTXd+aui0awU2FbJGPLk7GoLnEqcixWInuvrzr38I0ZoMbkLwizTwdWkm6Hvw1p3 tuGF8ej6ECnRWSKFp50i4OxhBdS2d2o/ntMH9JVgA2thjFEHToT8gxyU0thqmIQOW+9n Gu6dH1rmvjWvE55wtJyYRhBfhCHpWVrW+KAHpNz5SzCh+RRQFeiXgwMywIKapVrqSmYL PZ7RSdXWHuueZYh7moJwLi36YfOQuL6pbAIdJY47O4ChIXOdU9CxndDyeCvS7Qvpg18a KLfCCAP3x3ldtVgzP43a1WiNEWL06WHB8zY6GW0dFJfcdRmIYjls19YCbjtx1OB0/mlx mF2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=EsivCMF2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12-v6si8093026pgh.261.2018.08.19.17.03.27; Sun, 19 Aug 2018 17:03:43 -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=fail header.i=@thunk.org header.s=ef5046eb header.b=EsivCMF2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726546AbeHTDPl (ORCPT + 99 others); Sun, 19 Aug 2018 23:15:41 -0400 Received: from imap.thunk.org ([74.207.234.97]:54660 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbeHTDPk (ORCPT ); Sun, 19 Aug 2018 23:15:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/2ijYlux+YbKK4Pgbo7v9AAZVjfOv2k2GoIBwaOV/jE=; b=EsivCMF2EBft3W/BfmnDEQcgNO Wz+9FFygXdh7of3qIru9GHLEtPP+3L6U3DZAb6dtBX24EOMhr+yB5EyAKB/nORJ+yPZvSNVD1oqQs T1ALrcvYW9hhF/QMWqTwH9zoquAB15dLYQw33SIyCcYE1Mdmnw9D659pjc1+zEPSiUEI=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1frXeG-0004Ow-3V; Mon, 20 Aug 2018 00:02:20 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 4B78F7A57A8; Sun, 19 Aug 2018 20:02:18 -0400 (EDT) Date: Sun, 19 Aug 2018 20:02:18 -0400 From: "Theodore Y. Ts'o" To: Stephen Rothwell Cc: Linus Torvalds , Linux-Next Mailing List , Linux Kernel Mailing List Subject: Re: linux-next: build warnings from Linus' tree Message-ID: <20180820000218.GE19200@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , Stephen Rothwell , Linus Torvalds , Linux-Next Mailing List , Linux Kernel Mailing List References: <20180820081323.23a47af3@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180820081323.23a47af3@canb.auug.org.au> User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 20, 2018 at 08:13:23AM +1000, Stephen Rothwell wrote: > fs/ext4/super.c: In function '__save_error_info': > fs/ext4/super.c:344:2: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] > strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func)); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > fs/ext4/super.c:349:3: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] > strncpy(es->s_first_error_func, func, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > sizeof(es->s_first_error_func)); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All of ext4 superblock char[] fields are not necessarily null terminated, so this is a false positive. I suppose we could do something like this: inline char * strncpy_I_solemnly_swear_I_know_what_I_am_doing(char *dest, const char *src, size_t n) { #if __GNUC_PREREQ (8, 2) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstringop-truncate" #endif return strncpy(dest, src, n); #if __GNUC_PREREQ (8, 2) #pragma GCC diagnostic pop #endif } (if we really think this warning is worthwhile enough that we don't just want to globally disable it, of course) - Ted P.S. It's really, really too bad there isn't a simpler way to shut up gcc. You need the #ifdef __GNUC_PREREQ nonsense because otherwise older versions of gcc that don't understand the particular warning you're trying to suppress will complain loudly. (Ask me how I know....)